Code: Select all
00007C00 EB50 jmp short 0x7c52 <----- this jump actually jumps into the middle of an instruction
00007C02 90 nop
00007C03 6D insw
00007C04 6B66732E imul sp,[bp+0x73],byte +0x2e
00007C08 6661 popad
00007C0A 7400 jz 0x7c0c
00007C0C 0204 add al,[si]
00007C0E 0400 add al,0x0
00007C10 0200 add al,[bx+si]
00007C12 0200 add al,[bx+si]
00007C14 00F8 add al,bh
00007C16 40 inc ax
00007C17 0020 add [bx+si],ah
00007C19 004000 add [bx+si+0x0],al
00007C1C 0000 add [bx+si],al
00007C1E 0000 add [bx+si],al
00007C20 0000 add [bx+si],al
00007C22 0100 add [bx+si],ax
00007C24 800029 add byte [bx+si],0x29
00007C27 AD lodsw
00007C28 7FD3 jg 0x7bfd
00007C2A 0F426F6E cmovc bp,[bx+0x6e]
00007C2E 734F jnc 0x7c7f
00007C30 53 push bx
00007C31 2020 and [bx+si],ah
00007C33 2020 and [bx+si],ah
00007C35 204641 and [bp+0x41],al
00007C38 54 push sp
00007C39 31362020 xor [0x2020],si
00007C3D 200E1FBE and [0xbe1f],cl
00007C41 5B pop bx
00007C42 7CAC jl 0x7bf0
00007C44 22C0 and al,al
00007C46 740B jz 0x7c53
00007C48 56 push si
00007C49 B40E mov ah,0xe
00007C4B BB0700 mov bx,0x7
00007C4E CD10 int 0x10
00007C50 5E pop si
00007C51 EBF0 jmp short 0x7c43 ; <------- This is a bogus jump!
00007C53 8CC8 mov ax,cs
00007C55 8ED8 mov ds,ax
00007C57 8EC0 mov es,ax
00007C59 8EE0 mov fs,ax
00007C5B 8EE8 mov gs,ax
00007C5D 31C0 xor ax,ax
00007C5F 8ED0 mov ss,ax
00007C61 BC007C mov sp,0x7c00
00007C64 FB sti
00007C65 BE6F7C mov si,0x7c6f
00007C68 E81400 call 0x7c7f
00007C6B FA cli
00007C6C F4 hlt
00007C6D EBFC jmp short 0x7c6b
00007C6F 48 dec ax
00007C70 656C gs insb
00007C72 6C insb
00007C73 6F outsw
I see why I can't recreate the problem. I modified your createImage.sh file yesterday to avoid doing any of the stuff related to moving things around in the BPB. Here in particular:
Code: Select all
dd if=/dev/zero of=./bin/img/partition.dd bs=512 count=65536 # count = [ K = megabyte; K*(1024)^2/512 ]
mkfs.vfat -F 16 -n "BonsOS" ./bin/img/partition.dd
#Add file to the partition
#mcopy -i ./bin/img/partition.dd ./bin/boot/loader.bin ::/
#mcopy -i ./bin/img/partition.dd ./bin/kernel/kernel.sys ::/
#Add the bootloader to the partition
dd if=bin/boot/boot.bin of=./bin/img/partition.dd seek=0 count=1 conv=notrunc bs=3
dd if=bin/boot/boot.bin of=./bin/img/partition.dd seek=83 seek=83 skip=83 count=$[512-83] conv=notrunc bs=1
As a test - if you were to write boot.bin directly to the start of partition.dd, the VBR (without modification) should work.