elks-enhanced
public
Read
Owner: themaster
Branch: master
Commits: 6893
Updated: 2026-04-19 00:15
Git CLI clone URL
git clone https://www.xt-emporium.com/git/elks-enhanced.git
Fullscreen desktop URL
Code
Commits
History
Branches
Bug Reports
Discussions
Compare
Settings
elks-enhanced
/
Documentation
/
html
/
technical
/
process_man.html
File editor
<P> Each process gets a single segment for data+stack+heap. This is necessary because 'C' pointers must be usable interchangeably between objects in these three areas. The bcc compiler currently assumes SS=DS=ES. <PRE> +------------+--------------------------------------------------+ | data + bss | heap ---> | <--- stack | +------------+--------------------------------------------------+ ^ ^ current->t_enddata current->t_endstack </PRE> <P> Memory allocation for a new process is done in sys_execve() in fs/exec.c. The binary file header, defined in <linuxmt/minix.h>, gives the sizes of the areas to allocate: <UL> <LI>tseg (bytes 8..11) - code size <LI>dseg (bytes 12..15) - data size <LI>bseg (bytes 16..19) - bss size [uninitialised data, filled with zeros] <LI>chmem (bytes 24..27) - total data segment </UL> <P> Hence current->t_enddata is initialised to dseg+bseg, and current->t_endstack to chmem. The position of current->t_enddata can be changed by the "sys_brk" system call, which is in turn used by the malloc functions in libc. <P> When the linker (ld) creates a binary it gives a default setting for chmem (see writebin.c in the ld source). If you know that a particular program uses little or no heap, you can patch bytes 24..27 in the executable to a lower value: dseg+bseg+desired stack size.
Commit message
This repository is read-only for this account.
Repository snapshot
Current branch
master
Visibility
public
Your access
Read
Remote
Configured
File activity
View file history