CST 334 - Learning Journal Entry Week II

 

Flavio Cervantes

July 3, 2025

Journal Entry Week II

In CST 334, this week I learned the importance regarding why the OS is in charge of communicating with the physical hardware utilizing trap handlers, to achieve this the mechanism of a CPU utilizes a user mode (restricted and a kernel mode (non-restricted). The typical app. Run in user mode, and with a system call they are able to trap the non-restricted (kernel) to communicate directly with the services the OS provides.

Regarding C API’s, one can utilize fork (), exec (), or wait () for the ability to manage and perform certain task.  In order to create new processes, one can use the system call: fork (). For each process, they are tagged with a PID (process identifier), these PIDS can be utilized for specific actions against the respective PID such as kill PID, which sends a termination command to the PID. The underlying functions that support multi-programming are interesting in general, it takes more than the items listed above, it also involves a kernel, to organize a table of all active processes, pre-emptive scheduler, which is a timer utilized to mange the OS to shift from process to process with minimal errors. Virtualization in memory, which tricks the OS into thinking each process has its reserved address space.

I also learned about the signals that the systems such as OS, process, or users utilize; such as ALT +F4, which send a signal via signal() || sigaction() – these signals are designed to interrupt any process but need to be uses accordingly with custom handles to ensure there is proper memory cleanup or saving the working file.  There is also a great important in error handling in C, with some other languages such as python the functions will have it built-in error handling, but in C; we want to ensure our function return codes such as NULL, -1, False, etc. This ensures that in the case of resource exhaustion, invalid permission, null data, etc. it’s easier to debug. Another important method to assist in debugging, is to utilize perror() or errno.

Comments

Popular posts from this blog

Learning Journal - CSUMB - January 6, 2025

Learning Journal - Week IV

Learning Journal - CSUMB - January 15, 2025