

Keyboard: type=mf, serial_delay=200, paste_delay=100000 Vgaromimage: file=/usr/share/bochs/VGABIOS-lgpl-latest Romimage: file=/usr/share/bochs/BIOS-bochs-latest, address=0xfffe0000 Fill the rest of bootsector with zeroes and end it
#Bochs not loading latest image Pc
Then I tried to load my old PC from this flash drive, and it works! It loads program and executes it correctly. However, nothing had been loaded after int 13h executed. So I tried to debug it with Bochs and noticed that Bochs recognizes this binary file as bootable. Laptop loads Intel UNDI and gives me the following error: No bootable device - insert boot disk and press any key. I wrote bootloader to USB flash drive with dd if=main.bin of=/dev/sdb bs=512. It works correctly in QEMU, however, I have troubles running it with Bochs and my laptop. Bochs just hungs just after printing "jumping to second stage"( Print call just before jumping to second stage).

It seems second stage is not getting loaded at 0x500. I am trying to find and load second stage bootloader at memory address 0x500.

MsgFailure db 0x0D, 0x0A, "ERROR : Press Key to Reboot", 0x0A, 0x00 ImageName db "KRNLDR SYS" must be 11 bytes Retf far return, both of the above value will be used Test ax, 0x0001 if this was odd cluster => lower 12 bits, else =>higher 12 bits will be used

Mov bx, 0x0200 location of FAT in memoryĪdd bx, cx we moved 3/2*cluster no bytes from start compute next cluster, remember cluster entries are of 12 bits = 3/2 bytes load image file into memory at 0050:0000 => 0x500) location of FAT in ax = no of reserved Sectors compute size of FAT and store in cx = no of FAT * sectors per FAT Mov di, 0x0200 address of root table in memory read root directory into memory 0x7C0:0x0200 = 7C00+0200 location root directory = reserved sectors + (no of FATS * sectors per FAT)Īdd word, cx start of data sector size of root directory = 32*(no of root entries)/(bytes per sector) SECTORS absoluteTrack = logical sector / (sectors per track * no of heads) absolute head = (logical sector / sectors per track) % no of heads absolute sector = (logical sector % sector per track) + 1 Mov ah, 0x02 prepare bios read interruptĪdd bx, word next read buffer locationĪdd ax, word base of data sectors Mov di, 0x0005 we will try 5 times if failedĬall LBACHS we will get absolute sector, absolute head and absolute track information from here Mov ah, 0eh prepare fro bios vedio interuppt call string pointed by ds:si, terminated by 0 must start 3 bytes after start (jmp main is of 3 byte)īpbOEM db "My OS " OEM identifier (Cannot exceed 8 bytes!) I am following brokenthorn OS development series, until now I am able sucessfully run bootloader stage1 but there is some issue with loading second stage bootloader from FAT12 floppy in bochs emulator on linux machine(ubuntu 16.04) (It works fine in virtual box though).
