1. I couldn't make it use a flat Code segment but for the time being I can settle with just using a flat data selector.
2. I've glued my kernel to the end of the file (ie STAGE2 + BITMAP + KERNEL) and in the code I try to copy it to the 1mb mark. But it crashes. I'm not sure whether that is because I haven't enabled A20 correctly or what. I've attached the code. I think it crashes at (checked with Bochs and the debug message afterwards is never printed even on real hardware):-
Code: Select all
mov esi, [kern_ptr]
mov edi, 0x100000
mov cx, KERN_SIZE
rep movsb
Code: Select all
nasm -f bin -o stage2.bin stage2.asm
copy /b /y stage2.bin + logo.bmp + kernel.bin load.bin
copy /y load.bin a:\
Pete
[attachment deleted by admin]