aglist on 18 May 2004 17:40:03 -0000 |
Kevin, thanks for responding. what i am trying to do is to be able to create a memory segment to have a hardware protected large block of memory (64M at the bare minumum). i would rather my prog seg fault than have a run away pointer problem if the memory is not properly accessed. if use the standard malloc in the default heap segment, that single area would not be protected. i would like to create in address space: ------------------- | text segment | ------------------- | stack, heap seg | ------------------- | my own seg | ------------------- but i did not know in depth how it works. that's why i want to look up how linux handles/creates the default segments and user created segments. i have more questions like "if i malloc 64M+ of memory, are all the pages automatically created, or does it only create pages and table entries as the memory is accessed." the same question goes for user created segments. i do not want to use all my swap space on empty pages and really large page directories. but instead of asking every question i have, i want to be find some good resources i can read all i can about it, then ask any remaining questions. but i am having problems finding any good resources. (other than source code, but that's my last resort) and this is for an application in userland. thanks, -- adam grossman >> howdy, >> >> i want to write a programmer which create and uses it's own memory >> segment >> on x86. the problem is i can not find much information on how to use >> it. >> when i search for modify_ldt, i just get a lot of man pages. does >> anybody >> know any books (online or dead tree), articles, stone tablets, etc, >> that >> explains in detail how to use ldt_modify, how not to have mem segs >> trample >> each other in the address space, how the loader places the different >> segments (code, text, etc) and how it access it during the program >> running. i hope it is a not more complicated than just saying "create >> new >> mem seg" and loading the CR3 register whenever i want to use it... >> >> this is not only for something i want to write, but an academic >> exercise >> to see if i can do it and learn from it. >> >> thanks, >> -- adam grossman > > > Interesting question ... are you trying to study compilers and linkers > or do some user application programming? I wasn't sure, because your > initial question asks about *ldt (which I'm not the familiar with, but a > quick check shows it's a process memory management interface) but then > you talk about the program accessing memory. Generally program access > to memory is handled by functions supplied by the language you are using > (malloc/free in C, for example) > > If you wanted to study linkers/loaders you might want to do some > searching on the linker (gnu ld on linux) or the loader (escapes me at > the moment.) > > -- > Kevin Brosius > ___________________________________________________________________________ > Philadelphia Linux Users Group -- > http://www.phillylinux.org > Announcements - > http://lists.phillylinux.org/mailman/listinfo/plug-announce > General Discussion -- > http://lists.phillylinux.org/mailman/listinfo/plug > ___________________________________________________________________________ Philadelphia Linux Users Group -- http://www.phillylinux.org Announcements - http://lists.phillylinux.org/mailman/listinfo/plug-announce General Discussion -- http://lists.phillylinux.org/mailman/listinfo/plug
|
|