restaw.blogg.se

Use imgburn to create floppy image for bochs
Use imgburn to create floppy image for bochs








use imgburn to create floppy image for bochs

absolute head = (logical sector / sectors per track) MOD number of heads absolute sector = (logical sector / sectors per track) + 1

use imgburn to create floppy image for bochs

Mov cl, BYTE convert byte to wordĪdd ax, WORD base data sector LBA = (cluster - 2) * sectors per cluster Test ax, 0x0001 test for odd or even clusterĪnd dx, 0000111111111111b take low 12 bitsĬmp dx, 0x0ff0 test for end of file marker Pop bx get location to write to so we dont screw up the stack Mov dx, WORD DI points to file entry in root directory table. Push bx BX=>BP points to buffer to write to store it for laterĬall FindFile find our file. Pop ax return value into AX contains entry of file Mov di, ROOT_OFFSET locate first root entry at 1 MB mark ret/ AX => File index number in directory table. read FAT into memory (Overwrite our bootloader at 0x7c00) compute location of FAT and store in "ax" Mov WORD, ax base of root directoryĬall ReadSectors read in directory table compute location of root directory and store in "ax" Mul WORD total size of directoryĭiv WORD sectors used by directory compute size of root directory and store in "cx" bin/boot/loader.bin ::/ĭd if=./bin/boot/boot.bin of=BonsOS.img seek=0 count=1 conv=notruncĪnd finally run qemu-system-x86_64 -fda BonsOS.img -m 512M -no-reboot -no-shutdown I am absolutely sure that LoadRoot and LoadFile works since I've copied it from my last project which worked fine but if necessary I'll add them here.Īfter assembling the files with nasm I create a floppy image as so: dd if=/dev/zero of=BonsOS.img bs=1024 count=1440 The bootloader fails to find the loader.bin file and print the "E". Yout may recognize some bits of code from MonkOS and Brokenthorn since all my knowledge comes from them and OSDevWiki. My problem is that the first stage bootloader does not load the seconds from the disk. I have a little bit of experience in OSDEV but not that much. I am trying to develop a small OS with custom bootloader.










Use imgburn to create floppy image for bochs