Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions Lab 5/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
SUBDIR = kernel # bootloader

BUILDSUBDIR = $(SUBDIR:%=build-%)
CLEANSUBDIR = $(SUBDIR:%=clean-%)

SD_DIR = sd
FS_DIR = rootfs

all: $(SD_DIR)/initrd.cpio $(BUILDSUBDIR)

$(SD_DIR)/initrd.cpio:
cd $(SD_DIR)/$(FS_DIR) && ls -a | cpio -o -H newc > ../../$@ && cd ..

$(BUILDSUBDIR):
@echo "===>" $@
$(MAKE) -C $(@:build-%=%)
@echo "<===" $@

$(CLEANSUBDIR):
@echo "===>" $@
$(MAKE) -C $(@:clean-%=%) clean
@echo "<===" $@

clean: $(CLEANSUBDIR)
rm -f $(SD_DIR)/*.cpio


# $(call make_subdir, clean)

.PHONY: all clean $(SUBDIR) $(BUILDSUBDIR) $(CLEANSUBDIR) $(SD_DIR)/initrd.cpio
43 changes: 43 additions & 0 deletions Lab 5/docs/TODO.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
### Basic Exercise 1 - Buddy System - 40%

**Todo**
```
Implement the buddy system fro contiguous page frames allocation and your max order should be larger than 5.

(You don't need to handle the case of out-of-memory.)
```


**The Frame Array**
```
For each entry in The Frame Array with idx and value val
(Suppose the framesize to be 4kb)

val
>= 0 : allocatable
= <F> : belongs to a larger block
= <X> : already allocated

Frame Freelists
linkedlists

```




### Basic Exercise 2 - -














Loading