Hi. I wrote my 2 stages bootloader which enable protected mode with A20 and jump to kernel in C. (0x100000)
In this kernel I have functions printf-like to print memory map (got from bios-int in bootloader). In qemu everything is working and kernel halt after printfs.
In real machine (laptop about 200MHz, Pentium?, something like that), computer is restarting probably after displaying messages (I'm able to see "Memory map count: bla bla"). At the end of main I have only "for(;;);".
But if I add calling Delay function (which is "for(a=0; a < 10000000; a++);"), I'm not able to see any message from kernel. Looks like this Delay function is rebooting PC. Can You help me?
I attached my floppy image and source codes. Probably bootloader is good enough and problem is in kernel (kernel.c) (compiled via cross-gcc) or in stack settings?
I will be grateful if You help me
Attachment is there: http://www.cybek.cba.pl/_asm/cybOS32.rar
PS: cybfs.img is fdd image, cybFSman is my "filesystem" manager
Working on qemu, rebooting real machine
Re: Working on qemu, rebooting real machine
Computer does "for(a=0; a < 10000000; a++);" pretty quick, to make it worst if you enabled optimized it probably be omitted, your C code will soon end and the computer execute anything random after that, and probably crash very soon.
For having it "work on qemu but not work on real machine", it mostly cause by incomplete initialization, where emulators put the machine in good state by default (memory zero'ed, etc).
For having it "work on qemu but not work on real machine", it mostly cause by incomplete initialization, where emulators put the machine in good state by default (memory zero'ed, etc).
Re: Working on qemu, rebooting real machine
But this for is only for delay and if I don't call it, I'm able to see for second a messages.
And at end of main function I have infinitive loop ( "for(;;);" ) so computer should halt, not do anything random.
I will look at my initialization code and check it. Thanks.
And at end of main function I have infinitive loop ( "for(;;);" ) so computer should halt, not do anything random.
I will look at my initialization code and check it. Thanks.