Monday, February 20, 2017 6:02:38 PM
- CPU can load instructions only from RAM. The factory installed programs on smartphones are stored in EEPROM.
- Note that in networking devices, measurements are provided as bits because data here is moved one bit at a time.
- All forms of memory basically provide an array of bytes where each byte has its own address. “Load” and “Store” instructions are performed on these bytes.
- Almost all modern computers are based on the Von Neumann architecture and instructions are stored in the instruction register.
- Magnetic disk -> Solid state disks -> main memory (RAM) -> cache -> registers. Thus registers are the most basic memory unit in computers.
- For Input / output there are device controllers for every device that contain some local buffers and special purpose registers along with device drivers that facilitate interaction between the OS and device.
- DMA or direct memory access is an alternate model to the interrupt driven approach. In DMA, device controllers transfer blocks of data directly from their buffer storage to RAM with no intervention from the CPU.
Monday, December 26, 2016 7:50:54 PM
- Device controllers are connected through a common bus to a shared memory. For example, the mouse, keyboard and printer are all connected to the USB controller.
- Bootstrap program: It is the first program thats loaded on system startup. Its usually stored in the ROM or firmware (EEPROM). Unlike RAM, programs stored here are not erased on system shutdown.
- The bootstrap program initializes CPU registers, device controllers, memory and loads the kernel into memory to actually get the OS started. System daemons are programs that run all the time.
- How is the CPU controlled? By hardware (via system bus) and software interrupts (via system call). On receiving an interrupt the CPU stops its current execution, saves its current state on the system stack and transfers execution to the interrupt service routine and resumes its previous execution state after servicing the interrupt.
- A table of pointers are stored in low memory that point to various interrupt service routines of various devices (interrupt vector). So depending on the interrupt the appropriate routine is called.
- A bit is the most fundamental storage unit and can store either a 0 or 1. A byte is 8 bits, a computer with 64 bit registers and 64 bit addressing has 64 bit (8 byte) words. This native word size is the basic unit by which the computer will execute its instructions for that machine / architecture.
Sunday, December 11, 2016 8:17:25 PM
- OS is all about managing limited resources in the most efficient ways.
- How to keep the CPU busy all the time? How can maximum number of processes / threads utilize the CPU?
- How to make the best use of limited RAM? Because CPU can communicate only with RAM. So its important that we manage high speed limited RAM efficiently using ideas such as virtual memory, segmentation and paging.
- The CPU is the brain of the computer. The number of instructions it can execute per second / frequency is thus such a crucial factor. If it has multiple cores, its like the human brain hemispheres. Each part can work in tandem to do much more work.
- So process management is all about effectively managing processes and their use of the CPU. Thus it makes sense to have threads, share resources between process / threads etc.
- Memory management is all about managing RAM usage.
- The goal of a process will always be to gain access to the CPU and execute itself.
- The goal of the CPU will always be to keep itself busy executing processes.
- The goal of the RAM will be to match up the CPU execution speed by interacting with CPU and secondary storage.
- Processes need to be well behaved because they are working together for a common purpose in a constrained environment and they all want CPU access. Its better for them to run threads and cooperate with other processes.
- All major problems in the OS arise because we can only have so much CPU speed and so much RAM.
- The virtual memory will never let the system go out of memory. It creates an illusion that there is unlimited memory by doing a balancing act between shifting stuff around from RAM to SSD and vice versa.
Friday, August 12, 2016 12:04:21 PM
- Apple Mac OSX, Windows, Linux, Android and IOS are basically the most ubiquitously available and useful operating systems currently around.
- Process management, multithreaded programming, process scheduling, synchronization, deadlocks, memory management, virtual memory, file system, mass storage and system security are some of the key ideas in the study of operating systems.
- An operating system is a computer program that manages a computer’s hardware. The user basically interacts with system and application programs such as compilers, assemblers, text editors, database systems etc which in turn interact with the operating system which interacts with the hardware and gets the work done.
- What hardware are we talking about? CPU (central processing unit), memory and Input / Output devices.
- An operating system can be viewed as a resource allocator or a control program that manages the allocation of resources and ensures that improper use of the computer via user inputs is prevented.
- In the 1960’s Intel’s cofounder predicted that that the rate of transistors in an integrated chip will double every 18 months and that has held true remarkably! This is called Moore’s law. Thats why computers / phones have become smaller while becoming more powerful at the same time.
- An operating system is the one program that is running at all times and this is called the kernel. These are the core aspects of an OS that make it run. System programs (OS related) vs application programs (user related) is a good distinction to understand.
- Mobile OS have a middleware that provide support for databases, multimedia and graphics etc.
- POSIX (Portable operating systems interface) is a set of standards for UNIX based systems.