Tuesday, October 6, 2009

Coding on bare metal

Went through the startup process in the Minix book again. It makes more sense now. The next section explains interrupt processing excellently. This is where we really begin to understand how the illusion of multiple processes is created.


  1. Hi, the following is directly from Tanenbaum-Woodhull Minix book:
    "For example, a disk can be commanded to read by loading the values of the disk address, main memory address, byte count, and direction(read or write) into it's registers. In practice, many more paramenters ......"

    From above sentence, I came to think that the disk hardware can somehow access the main memory. All this while I have seen situations where processor accesses main memory, so this is hard for me to understand. Can you briefly explain how the disk microcontroller uses the main memory address? I don't want to get into complex hardware details but just enough to understand the role of Minix here. Thanks in advance.

  2. Haritha, Sorry about the delay but briefly: For performance reasons, to reduce load on the main processor, peripheral devices like the hard disk are designed to write to memory directly. If the processor has to do this, then not only do we use up the processor for this additional work but the data makes an additional hop: from the hard disk to the processor register and then from the register to main memory. So modern disks have Direct Memory Access (DMA) that enables them to write to main memory without involvement from the processor. The main memory location to write to is of course provided by the OS through the processor. Hope this makes sense.

  3. Thank you. The answer has been very helpful.