Protected Mode
Posted: Mon Aug 15, 2005 11:00 pm
I have been programming for 16-bit for a while, but was not able to transfer to protected mode with everything I needed answered... Can anybody help me?
1. Once transfered completely into protected mode, how can you change the memory? For example, if I am trying open a file, to run, I normally would find some free space, and put the code there, then just jump to the segment. In protected mode, I seem to have to change the memory in some way to have a free level 3 ring memory segment that I first write to, and then can only execute from after. How can I do this? (especially if multi-tasking).
2. Is there some tutorial that looks at mostly the interrupts and multi-tasking part? Most tutorials skip that saying something like 'we will stick to the basics'...
3. In multi-tasking, how can you detect which program is taking up more CPU (by precentage), and be able to set the priority of different programs, as done in windows?
4. If a bad command is sent by a 3 ring program, for example:
again: cli
hlt
jmp again
how can the OS detect this and stop it?
5. I have been able to set 4 GB of memory for my OS, but I don't understand how the computer knows what memory I want to allocate. In a tutorial, each memory segment seemed to be very similar to 16-bit.. bios sector, video sector, etc. ..but all on the same assigned 4 GB memory space that is for my OS. Can anybody explain how to remove this? ..and maybe change it so that there was also some memory assigned only for the video memory?
Sorry if I'm asking too much.. It's just that the tutorials usually hardly explain any of this...
1. Once transfered completely into protected mode, how can you change the memory? For example, if I am trying open a file, to run, I normally would find some free space, and put the code there, then just jump to the segment. In protected mode, I seem to have to change the memory in some way to have a free level 3 ring memory segment that I first write to, and then can only execute from after. How can I do this? (especially if multi-tasking).
2. Is there some tutorial that looks at mostly the interrupts and multi-tasking part? Most tutorials skip that saying something like 'we will stick to the basics'...
3. In multi-tasking, how can you detect which program is taking up more CPU (by precentage), and be able to set the priority of different programs, as done in windows?
4. If a bad command is sent by a 3 ring program, for example:
again: cli
hlt
jmp again
how can the OS detect this and stop it?
5. I have been able to set 4 GB of memory for my OS, but I don't understand how the computer knows what memory I want to allocate. In a tutorial, each memory segment seemed to be very similar to 16-bit.. bios sector, video sector, etc. ..but all on the same assigned 4 GB memory space that is for my OS. Can anybody explain how to remove this? ..and maybe change it so that there was also some memory assigned only for the video memory?
Sorry if I'm asking too much.. It's just that the tutorials usually hardly explain any of this...