OSDev.org

The Place to Start for Operating System Developers
It is currently Thu Mar 28, 2024 5:48 am

All times are UTC - 6 hours




Post new topic Reply to topic  [ 7 posts ] 
Author Message
 Post subject: allocated space
PostPosted: Fri Aug 19, 2005 3:55 am 
hi guys
what do u think is the best memory space i should reserve for kernel code, data, stack ?
and for user process, how much mem space i should allocate for each process (code, data, stack) ?


Top
  
 
 Post subject: Re:allocated space
PostPosted: Fri Aug 19, 2005 4:18 am 
Offline
Member
Member
User avatar

Joined: Tue Oct 17, 2006 11:33 pm
Posts: 3882
Location: Eindhoven
HardEnough wrote:
hi guys
what do u think is the best memory space i should reserve for kernel code, data, stack ?
and for user process, how much mem space i should allocate for each process (code, data, stack) ?


kernel data/code/stack: what it needs (depending on its size). In address space, say, half?

User process: look at the file and make space for it.


Top
 Profile  
 
 Post subject: Re:allocated space
PostPosted: Fri Aug 19, 2005 4:32 am 
In physical size of the kernel, as much as you need, in terms of the address space, the conventional size is 1GB of virtual addressing.

The conventional address space size for user apps is 2GB with 1GB reserved for loading libraries (aka DLLs). In terms of preallocation, you can allocate enough space for the whole binary straight up or you can use the typical 'faulting approach' (load nothing at all and just load the program in page by page as page faults occur)


Top
  
 
 Post subject: Re:allocated space
PostPosted: Fri Aug 19, 2005 5:15 am 
Offline
Member
Member
User avatar

Joined: Thu Nov 16, 2006 12:01 pm
Posts: 7612
Location: Germany
2 / 1 / 1 GB, as said above, is default for most desktop systems.

Servers (proxy caches, databases, that kind of stuff) frequently require much more user data to be kept than mere 2 GB; there are solutions that allow 3 GB and more to be allocated for application data, which is very welcome in such environments.

Games also tend into that direction. Consider "World of Warcraft" with a recommended physical memory of 1 GByte or more... won't be long before games, too, will consider 2 GB of allocateable RAM to be too small.

_________________
Every good solution is obvious once you've found it.


Top
 Profile  
 
 Post subject: Re:allocated space
PostPosted: Fri Aug 19, 2005 6:29 am 
that's for the virtual mem. but what about the physical one ?
i won't start with paging and swapping, i will be using pure segmentation so i need to know the how much mem. i need for the kernel code, data, stack .
i know it depends on the kernel but i mean in general (the average).


Top
  
 
 Post subject: Re:allocated space
PostPosted: Fri Aug 19, 2005 6:33 am 
Offline
Member
Member
User avatar

Joined: Thu Nov 16, 2006 12:01 pm
Posts: 7612
Location: Germany
No idea. Depends on your kernel architecture (monolithic or microkernel?), scope of your OS (generic desktop, server, game engine, embedded, ...), and many other factors that are also bound to change over time.

As for "pure segmentation"... what's your compiler of choice? I'm asking because GCC does not support segmentation, but assumes a flat memory model...

Edit: I was a bit at a loss for words, but now I found the metaphor: Your question is like asking us, "how much money should I take with me for my holiday?", but not telling us where you're going, how long you stay, and what your acount balance is. And even then we couldn't really give good advice... ;)

_________________
Every good solution is obvious once you've found it.


Top
 Profile  
 
 Post subject: Re:allocated space
PostPosted: Fri Aug 19, 2005 12:48 pm 
Quote:
how much money should I take with me for my holiday?
;D i'm going to hawaii
here is the problem, i will use grub to load the kernel at 100000h, then i will create gdt with Code segment, Data segment with base 0 and limit 4 GB to access the whole ram and Code,Data,Stack for the kernel which i don't know how to set their base or limit that's all.
all i know that the kernel is loaded at 100000h which means that the base of kernel code should be 100000h but what about the limit ?
and what about data where it starts and where it ends?
the stack can be any where but what about its size ?


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

All times are UTC - 6 hours


Who is online

Users browsing this forum: DotBot [Bot], Google [Bot] and 66 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