Page 1 of 1
PMODE LOAD HELP :)
Posted: Mon Apr 25, 2005 8:34 am
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)
Re:PMODE LOAD HELP :)
Posted: Mon Apr 25, 2005 8:51 am
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
Re:PMODE LOAD HELP :)
Posted: Mon Apr 25, 2005 9:05 am
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.