Written below is a collection of my miscellaneous and scattered notes representing what I learned from this week:
[in regards to buses]
- In regards to I/O, there are many types of "buses"
- Memory Bus: connects CPU with main memory
- General I/O bus: connects high-performance device like the GPU
- Peripheral I/O bus: connects slower devices like the mouse, keyboard, etc.
- in other words, buses are basically just types of wires that connect things to the cpu + protocols that tells devices when to talk, who the data is for, etc.
[in regards to OS-device protocol]
- so there's a concept called "polling" which is basically checking the status register continuously until a device is ready
- once it is read, it will write data to the data register
- In a concept called PIO (programmed I/O), the CPU itself will write and transfer the register
- Instead, there's another concept called DMA (direct memory access) where we have a separate hardware that will do the mundane task of copying data so it will free up the CPU.
- in other words: the CPU itself is personally responsible for copying data over, but DMA is basically having another "staff" that can take over that task so the CPU can do something else.
- if not polling, we can use interrupt timer to avoid polling in order to free up the CPU to do work on other processes.
[inodes]
- inode is a number and a data structure that stores everything about a file except its name and the data content
- it stores: creation time, last access time, last modification, file size, link count, etc.
[inode + data procedure effects on bitmap]
- mkdir() will +1 inode and +1 data
- creat() will +1 inode
- open(), write(), close() will +1 data
- link() will not change the bitmap
- unlink() will not change the bitmap OR -1 inode OR -1 inode and -1 bitmap
No comments:
Post a Comment