USF-OS / FogOS

Other
0 stars 48 forks source link

Add ps command to user space #51

Open geoweb999 opened 2 months ago

geoweb999 commented 2 months ago

ps displays information about active processes. The initial version will display all processes: pid, parent pid, current state, memory size, and program name. Processes in UNUSED state will be ignored. The initial version will support a -h flag for program information.

Approach: Update kernel as needed to introduce 22nd system call: getprocs and sys_getprocs. ps will pass a struct (ptable data) array pointer to the system call (getprocs). getprocs will iterate through all ptable entries where state != UNUSED and update the passed struct array pointer with ptable data via copyout. ps will output the returned ptable data in a nicely formatted manner. If the -h argument is used, ps will output simple help information and exit.

Files to be modified/added:

kernel:

user:

Future Development

geoweb999 commented 2 months ago

add update usys.pl

malensek commented 2 months ago

This is beautiful, your project is approved.

+1000000 matthew respect points