#include <sys/types.h> /* unistd.h needs this */
#include <unistd.h> /* contains read/write */
#include <fcntl.h>
int main()
{
char boot_buf[512];
int floppy_desc, file_desc;
file_desc = open("./boot", O_RDONLY);
read(file_desc, boot_buf, 510);
close(file_desc);
boot_buf[510] = 0x55;
boot_buf[511] = 0xaa;
floppy_desc = open("/dev/fd0", O_RDWR);
lseek(floppy_desc, 0, SEEK_CUR);
write(floppy_desc, boot_buf, 512);
close(floppy_desc);
}
내가하지 않았다 통해 플로피 디스크의 부트 섹터에 사용자 정의 로더를 쓰기로되어있어 플로피 드라이브가있는 PC와 VirtualBox를 통해 가상 머신에서 전체 프로젝트를 시도하는 것을 선호합니다.
그래서 내 가상 컴퓨터에서 호출 할 가상 CD 이미지에 사용자 지정 부트 섹터를 작성하는 방법은 무엇입니까? 당신이 어떤 다른 방법이있는 경우 :
그것을 제안하십시오 :