Page 2 of 2
Re: Second Stage Bootloader is not working...
Posted: Sat Sep 09, 2023 11:45 pm
by nullplan
neon wrote:For these scenarios you'll need to switch between real and protected modes or use unreal mode.
In addition to what Octo said, you really should not be using unreal mode. Unreal mode can be destroyed whenever BIOS switches to protected mode and then back to real mode. Indeed, BIOS has no way to tell that unreal mode is in use. And BIOS can switch modes potentially on every interrupt it handles, both hardware and software. There is a lot of hardware that cannot be serviced in real mode at all, e.g. USB and NVMe. SeaBIOS exists and you can look up its source code, and see all the mode switches in there.
On the flipside, function 15/87 is used in popular boot loaders, and therefore highly likely to be both present and working.
Re: Second Stage Bootloader is not working...
Posted: Sun Sep 10, 2023 4:18 pm
by Octocontrabass
nullplan wrote:Unreal mode can be destroyed whenever BIOS switches to protected mode and then back to real mode.
Ah, good point. You'd have to set up a #GP handler to catch the segment limit violations and return to unreal mode, and that's usually not worth the extra trouble for a bootloader.
Re: Second Stage Bootloader is not working...
Posted: Mon Sep 11, 2023 9:03 am
by nullplan
Octocontrabass wrote:Ah, good point. You'd have to set up a #GP handler to catch the segment limit violations and return to unreal mode, and that's usually not worth the extra trouble for a bootloader.
True. Plus, #GP is interrupt 9, which in BIOS compatible mode is supposed to be IRQ 1, the keyboard interrupt. So you'd need to deal with that, and the whole rat's tail just keeps getting longer.
Re: Second Stage Bootloader is not working...
Posted: Mon Sep 11, 2023 2:30 pm
by Octocontrabass
...You mean interrupt 13 and IRQ5?
Re: Second Stage Bootloader is not working...
Posted: Mon Sep 11, 2023 8:17 pm
by nullplan
And that's why i should have looked it up in the CPU manual rather than in RBIL. You are absolutely correct.
Re: Second Stage Bootloader is not working...
Posted: Fri Sep 15, 2023 1:19 pm
by protos
I have kinda adopt the direction from above, now i get it that the interrupt cannot go over 1MB, okay, i can then copy it over on chunks if i need later. and no, i really dont want to use any existing stuff for boot anything. now the other boggling questing to me ist, can you give me working Bochs BGA Code ?
Back in the time on DOS witj DJGPP, i could swear i had changed the bios-font without, mode swiching ? Oh and btw, can you also re-teach me how to do that, at least in that emulator ?
However, i thank you all for your might <3
Re: Second Stage Bootloader is not working...
Posted: Fri Sep 15, 2023 4:26 pm
by Octocontrabass
protos wrote:Back in the time on DOS witj DJGPP, i could swear i had changed the bios-font without, mode swiching ? Oh and btw, can you also re-teach me how to do that, at least in that emulator ?
Changing the text mode font is a VGA feature.
In real mode, you can call INT 0x10 AX=0x1100 or INT 0x10 AX=0x1110 to load a new font.
In protected mode, you can poke some VGA registers to access the VGA memory where the font is stored to load a new font.