Week 3


1. Linux

Implement a simulated shell, called nsh. When running the operating system, write nsh in command line to start. In this simulated shell, we can also run some commands as in the original shell.

Implement the buddy allocation (kernel/buddy.c), which allocates and free file structs so that xv6 can have more open file descriptors
.


  • What is buddy allocation?
  • In a buddy system, the entire memory space available for allocation is initially treated as a single block whose size is a power of 2. When the first request is made, if its size is greater than half of the initial block then the entire block is allocated. Otherwise, the block is split in two equal companion buddies. If the size of the request is greater than half of one of the buddies, then allocate one to it. Otherwise, one of the buddies is split in half again. This method continues until the smallest block greater than or equal to the size of the request is found and allocated to it.
  • In this method, when a process terminates the buddy block that was allocated to it is freed. Whenever possible, an unallocated buddy is merged with a companion buddy in order to form a larger free block. Two blocks are said to be companion buddies if they resulted from the split of the same direct parent block.

Design how to create address space. The central data structure is pagetable_t (it can be used for both kernel page table and process page table), which is really a pointer to a RISC-V root page-table page. The walk function will find the PTE for a virtual address, and mappages, which installs PTEs for new mappings. 




2. Bootloader

Search for the knowledge about u-boot on the Internet, watch videos about u-boot uploaded by others online, and learn how to install and write u-boot based on the tutorial.



3. SoC

  1. Construct Control Unit, and test ALU control and register file (commits on Feb 10, 2020)
  2. Test the ALU with new extension support and fix the bugs (commits on Feb 9, 2020)
  3. Confirm the function of SDRAM to DDR Component provided by Digilent on board (commits on Feb 12, 2020)
    1. Advantages: It can be directly used to save time
    2. Disadvantages: minimum writing time is 260ns and reading time is 210ns, which causes huge memory operation latency. In addition, it doesn’t have the output for a normal bus that guarantees the communication between memory and CPU core
    3. Problem existing: After reading or writing many times to memory, it will obviously lose data (maybe caused by refresh rate of DDR2 SDRAM in this FPGA)
  4. Construct register between each stage used in pipeline processor
  5. Test Control Unit and fix the bugs (commits on Feb 15, 2020)

Figure 1. Test of ALU




评论

此博客中的热门博文

Week 1

Week 2

Week 4