OSDev.org

The Place to Start for Operating System Developers
It is currently Sun Apr 28, 2024 6:35 am

All times are UTC - 6 hours




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: Setting EFLAGS after booting
PostPosted: Sat Dec 23, 2023 10:26 am 
Offline
Member
Member
User avatar

Joined: Sun Jul 21, 2019 7:34 am
Posts: 300
My kernel boots into protected mode with GRUB, the multiboot spec says "Bit 17 (VM) must be cleared. Bit 9 (IF) must be cleared. All other bits are undefined".
Since I think I should set the other bits manually, but which bits and to what value should I set them?
For example, I think I need to set the IOPL bits to 00.


Top
 Profile  
 
 Post subject: Re: Setting EFLAGS after booting
PostPosted: Sat Dec 23, 2023 2:51 pm 
Offline
Member
Member

Joined: Wed Aug 30, 2017 8:24 am
Posts: 1605
For most things, you can just set all bits zero. Just
Code:
push $0
popfd
after setting up the stack. This initializes all the spec forgot to mention. It clears VM and IF and IOPL and DF. And then you can work from there.

_________________
Carpe diem!


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: No registered users and 34 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