next comes kernel compilation for Advanced OS class, where make menuconfig reports some error in ubuntu.. after some digging someone found out that we have to install libncurses-dev package for it to work, and i remembered that funny incident that happened 3 years before.
the assignment questions seemed simple
- Observing “Linux“ behavior“ by writing a program to use the /proc mechanism to inspect various kernel values
- Learn how to write a UNIX—style shell program
so i want to add interactivity to my shell , that is history, command completion etc.. , so i have to capture keystrokes, but what shit, ours is not a complete shell, so the shell that we run on didn't give us the keycodes that we expect .. after a lot of blah blah .. nurses or ncurses came to resuce, there is a getch() function will capture all keys if we set keypad(stdsrc,TRUE), done...
worked for three more days to "port".. when every thing is working .. Hmm this is not what i wanted SEGMENTATION FAULT, why the hell!!, Hmm if do chdir() there is a seg fault, i got bugged of curses so had to revert back to non-interactive shell, but i can upgrade my proc code to work as a task manager (like top command) again 2 days of work, i could implement killing a process provided you have sufficient access rights, ya i know it has lot of flaws but i believe it is a "proof of concept" , now ask me do something in ncurses, i can do it with a bit of struggle.
next is a file manager in queue .. (long live ncurses ).
food for thought: try "tpp" the ncurses based based presentation program, ultimate, so decided to torture people with "tpp" (available in ubuntu/debian repos)
Blogged with Flock
No comments:
Post a Comment