OSDev.org

The Place to Start for Operating System Developers
It is currently Sat Apr 27, 2024 1:42 pm

All times are UTC - 6 hours




Post new topic Reply to topic  [ 22 posts ]  Go to page Previous  1, 2
Author Message
 Post subject: Re: Second Stage Bootloader is not working...
PostPosted: Sat Sep 09, 2023 11:45 pm 
Offline
Member
Member

Joined: Wed Aug 30, 2017 8:24 am
Posts: 1605
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.

_________________
Carpe diem!


Top
 Profile  
 
 Post subject: Re: Second Stage Bootloader is not working...
PostPosted: Sun Sep 10, 2023 4:18 pm 
Offline
Member
Member

Joined: Mon Mar 25, 2013 7:01 pm
Posts: 5146
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.


Top
 Profile  
 
 Post subject: Re: Second Stage Bootloader is not working...
PostPosted: Mon Sep 11, 2023 9:03 am 
Offline
Member
Member

Joined: Wed Aug 30, 2017 8:24 am
Posts: 1605
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.

_________________
Carpe diem!


Top
 Profile  
 
 Post subject: Re: Second Stage Bootloader is not working...
PostPosted: Mon Sep 11, 2023 2:30 pm 
Offline
Member
Member

Joined: Mon Mar 25, 2013 7:01 pm
Posts: 5146
...You mean interrupt 13 and IRQ5?


Top
 Profile  
 
 Post subject: Re: Second Stage Bootloader is not working...
PostPosted: Mon Sep 11, 2023 8:17 pm 
Offline
Member
Member

Joined: Wed Aug 30, 2017 8:24 am
Posts: 1605
And that's why i should have looked it up in the CPU manual rather than in RBIL. You are absolutely correct.

_________________
Carpe diem!


Top
 Profile  
 
 Post subject: Re: Second Stage Bootloader is not working...
PostPosted: Fri Sep 15, 2023 1:19 pm 
Offline

Joined: Sun Aug 27, 2023 3:47 pm
Posts: 8
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

_________________
Code:
https://github.com/krypniok/deuteros


Top
 Profile  
 
 Post subject: Re: Second Stage Bootloader is not working...
PostPosted: Fri Sep 15, 2023 4:26 pm 
Offline
Member
Member

Joined: Mon Mar 25, 2013 7:01 pm
Posts: 5146
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.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 22 posts ]  Go to page Previous  1, 2

All times are UTC - 6 hours


Who is online

Users browsing this forum: Bing [Bot], SemrushBot [Bot] and 14 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group