PMODE LOAD HELP :)

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
Comet Keeper

PMODE LOAD HELP :)

Post by Comet Keeper »

Hallo....

I'm looking for some information about loading modules in pmode. See what I done :): My boot can load a sys file from floppy through my own filesystem. This sys file sets up pmode and sets up a GDT. I know I have to set an IDT and here is the problem. How can I put code in memory if my code-seg is not writeble?? For test only, I put the HTL byte (0xf4) in a location in the code-seg and obviously the pc has rebooted. The question is: how can put/load code if the code-seg is read-only? I read the intel book for segment type specs, but I didn't find a code type that is writeble... Hence... How does loading module/service/tasks/application loading and executing works?? Can anyone explain to me this or give me some good detailed documentation???

Thank you
Comet Keeper (byte from italy)
srg

Re:PMODE LOAD HELP :)

Post by srg »

Comet Keeper wrote: Hallo....

I'm looking for some information about loading modules in pmode. See what I done :): My boot can load a sys file from floppy through my own filesystem. This sys file sets up pmode and sets up a GDT. I know I have to set an IDT and here is the problem. How can I put code in memory if my code-seg is not writeble?? For test only, I put the HTL byte (0xf4) in a location in the code-seg and obviously the pc has rebooted. The question is: how can put/load code if the code-seg is read-only? I read the intel book for segment type specs, but I didn't find a code type that is writeble... Hence... How does loading module/service/tasks/application loading and executing works?? Can anyone explain to me this or give me some good detailed documentation???

Thank you
Comet Keeper (byte from italy)
First thing will be to go through the FAQ, it's very good.

http://www.osdev.org/osfaq2

srg
User avatar
Pype.Clicker
Member
Member
Posts: 5964
Joined: Wed Oct 18, 2006 2:31 am
Location: In a galaxy, far, far away
Contact:

Re:PMODE LOAD HELP :)

Post by Pype.Clicker »

the thing is segments can overlap. That means you cannot write to "CODE" segment {selector=0x04, base=1MB, limit=3GB}, but you could write to a LOADING segment that would have similar (or enclosing) base/limit and that is read/writable.

Within the kernel, you usually have at least one segment that maps the whole address space with R/W capability that you can use to load applications/drivers/plugins/whatever.

Depending on your code protection policy you may or may not allow user apps to load more code by having some overlapping of the user-mode code and data segments.
Post Reply