Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

310555002 lab2 #169

Open
wants to merge 377 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
377 commits
Select commit Hold shift + click to select a range
1d0aaba
[lab4]: test
May 25, 2022
f0c9d36
[lab4]: finish lab4
May 25, 2022
a94dab5
[lab4]: finish lab4
May 25, 2022
5194536
[lab4]: fix some bugs
May 25, 2022
6d71a16
[lab4]: test
May 25, 2022
9b804f1
[lab4]: test
May 25, 2022
0fcd2e8
[lab4]: test
May 25, 2022
7b0c5eb
[lab4]: test
May 25, 2022
f820bbd
[lab4]: Because of some technical problem, I remove rules in Makefile…
May 25, 2022
ad8585b
[lab4]: Because of some technical problem, I remove rules in Makefile…
May 25, 2022
1db80dc
[lab5]: init lab5 directory
May 25, 2022
80d0f1f
[lab5]: add some file into lab5
May 25, 2022
feb4630
demo
May 26, 2022
71dfe5a
demo
May 26, 2022
4613ae2
demo
May 26, 2022
d27f58d
demo
May 26, 2022
6aba918
demo
May 26, 2022
4fd9d60
demo
May 26, 2022
d59621a
demo
May 26, 2022
c91f401
demo
May 26, 2022
510441b
demo
May 26, 2022
3affc6c
demo
May 26, 2022
32793c0
demo
May 26, 2022
40aa764
demo
May 26, 2022
78dbe91
demo
May 26, 2022
7491e12
demo
May 26, 2022
f6737b5
demo
May 26, 2022
a44e746
demo
May 26, 2022
398da77
demo
May 26, 2022
fb7d730
demo
May 26, 2022
2f54413
demo
May 26, 2022
6962699
demo
May 26, 2022
5afd84f
demo
May 26, 2022
34914b5
demo
May 26, 2022
73a9980
demo
May 26, 2022
f7d2d3a
demo
May 26, 2022
234fc9e
demo
May 26, 2022
1478257
demo
May 26, 2022
c684c5e
demo
May 26, 2022
25be732
demo
May 26, 2022
9bbd945
demo
May 26, 2022
ee472af
demo
May 26, 2022
6df5a86
demo
May 26, 2022
073223e
demo
May 26, 2022
a9cc2a3
demo
May 26, 2022
979eff8
[lab3]: fix buf
xiaobyee May 27, 2022
20f5141
demo
May 27, 2022
7e18cc9
demo
May 27, 2022
45e6c98
demo
May 27, 2022
9d09902
demo
May 27, 2022
73911b3
demo
May 27, 2022
34f2755
demo
May 27, 2022
8905d2c
demo
May 27, 2022
9fd8565
demo
May 27, 2022
67003e9
demo
May 27, 2022
84b8418
demo
May 27, 2022
a0887f2
demo
May 27, 2022
aa51cd1
[lab5]: finish basic 1
Jun 4, 2022
905255e
[lab5]: finish basic 1
Jun 4, 2022
7e9ecf7
[lab5]: finish basic 1
Jun 4, 2022
c161633
[lab5]: finish basic 1
Jun 4, 2022
82063bf
[lab5]: finish basic 1
Jun 4, 2022
c18c201
[lab5]: finish basic 1
Jun 4, 2022
0062d15
[lab5]: finish basic 1
Jun 4, 2022
1c4bd87
[lab5]: finish basic 1
Jun 4, 2022
8d9c1e1
[lab5]: finish basic 1
Jun 4, 2022
1b1c6ae
[lab5]: finish basic 1
Jun 4, 2022
2370af0
[lab5]: finish basic 1
Jun 4, 2022
0bdc369
demo
Jun 4, 2022
1baabeb
[lab5]: add some file into lab5
Jun 4, 2022
ba72176
[lab5]: finish basic 1
Jun 4, 2022
2280159
[lab5]: finish basic 1
Jun 4, 2022
77418aa
[lab5]: finish basic 1
Jun 4, 2022
a3ca2d7
[lab5]: finish basic 1
Jun 4, 2022
58845a9
[lab5]: finish basic 1
Jun 4, 2022
d460dc7
[lab5]: finish basic 1
Jun 4, 2022
df4ea89
[lab5]: finish basic 1
Jun 4, 2022
996d1b0
[lab5]: finish basic 1
Jun 9, 2022
d665e65
[lab5]: finish basic 1
Jun 9, 2022
8cd818d
[lab5]: finish basic 1
Jun 9, 2022
29d04a9
[lab5]: finish basic 1
Jun 9, 2022
684da76
[lab5]: finish basic 1
Jun 9, 2022
8ef000e
[lab5]: finish basic 1
Jun 9, 2022
b671fa0
[lab5]: finish basic 1
Jun 9, 2022
922981a
[lab5]: finish sys_uart_read & sys_uart_write
Jun 9, 2022
b90ee9e
[lab5]: finish sys_uart
Jun 9, 2022
7a17ecf
[lab5]: finish sys_fork
Jun 9, 2022
8b9df4a
[lab5]: finish sys_fork
Jun 9, 2022
df2f1f2
[lab5]: finish sys_fork
Jun 9, 2022
0ef957b
[lab5]: finish sys_fork
Jun 9, 2022
ba9cfe0
[lab5]: finish sys_fork
Jun 9, 2022
a148c11
[lab5]: finish sys_fork
Jun 9, 2022
22a7bf4
[lab5]: finish sys_fork
Jun 9, 2022
c571e82
[lab5]: finish sys_fork
Jun 9, 2022
2a9b255
[lab5]: finish sys_fork
Jun 9, 2022
17915bf
[lab5]: finish sys_fork
Jun 9, 2022
7081fbe
[lab5]: finish sys_fork
Jun 9, 2022
ff41bcf
[lab5]: finish sys_fork
Jun 9, 2022
fa0f7d3
[lab5]: finish sys_fork
Jun 9, 2022
9be87d0
[lab5]: finish sys_fork
Jun 9, 2022
22f1c01
[lab5]: finish sys_fork
Jun 9, 2022
85c7938
[lab5]: finish sys_fork
Jun 9, 2022
f75b860
[lab5]: fix some bug
Jun 9, 2022
41840a6
[lab5]: fix some bug
Jun 10, 2022
de8ecea
[lab5]: finish sys_fork and sys_getpid
Jun 10, 2022
f5d7304
[lab5]: finish sys_fork and sys_getpid
Jun 10, 2022
7b0278c
[lab5]: test
Jun 10, 2022
e140493
[lab5]: test
Jun 10, 2022
2deb0e1
[lab5]: test
Jun 10, 2022
da230f0
[lab5]: test
Jun 10, 2022
0025960
[lab5]: test
Jun 10, 2022
fdf09b2
[lab5]: test
Jun 10, 2022
ac075ef
[lab5]: test
Jun 10, 2022
8c5492b
[lab5]: test
Jun 10, 2022
5a28e33
[lab5]: test
Jun 10, 2022
33196ba
[lab5]: test
Jun 10, 2022
def4f27
[lab5]: test
Jun 10, 2022
258f268
[lab5]: test
Jun 10, 2022
c04bde3
[lab5]: test
Jun 10, 2022
b9b2e11
[lab5]: test
Jun 10, 2022
bcce874
[lab5]: test
Jun 10, 2022
be8075c
[lab5]: test
Jun 10, 2022
f217405
[lab5]: test
Jun 10, 2022
8d3ba53
[lab5]: test
Jun 10, 2022
d443c27
[lab5]: test
Jun 10, 2022
1b36cbf
[lab5]: test
Jun 10, 2022
06ae1c2
[lab5]: test
Jun 10, 2022
230e162
[lab5]: test
Jun 10, 2022
c0d6955
[lab5]: modify structure of system call
Jun 10, 2022
b2ca5b3
[lab5]: fix multiple trap frame problem
Jun 10, 2022
8b9c75d
[lab5]: set HZ to 32
Jun 10, 2022
85316e2
[lab5]: change initramfs.cpio
Jun 10, 2022
234253c
[lab5]: change initramfs.cpio
Jun 10, 2022
9644b43
[lab5]: change async io to sync io
Jun 10, 2022
83c8893
[lab5]: change async io to sync io
Jun 10, 2022
db51be3
[lab5]: test
Jun 10, 2022
466a079
[lab5]: test
Jun 10, 2022
e7ad8fa
[lab5]: test
Jun 10, 2022
7dac450
[lab5]: test
Jun 10, 2022
0f61696
[lab5]: test
Jun 10, 2022
ddbc3b3
[lab5]: test
Jun 10, 2022
d17c2a7
[lab5]: test
Jun 10, 2022
cd21c6f
[lab5]: test
Jun 10, 2022
33fdf85
[lab5]: test
Jun 11, 2022
96374bf
[lab5]: test
Jun 11, 2022
f025189
[lab5]: test
Jun 11, 2022
d34256f
[lab5]: test
Jun 11, 2022
ce42c3e
[lab5]: test
Jun 11, 2022
e32369c
[lab5]: test
Jun 11, 2022
7cb581f
[lab5]: test
Jun 11, 2022
bf659c8
[lab5]: test
Jun 11, 2022
ccac93c
[lab5]: test
Jun 11, 2022
4ac25c5
[lab5]: test
Jun 11, 2022
3e28a78
[lab5]: test
Jun 11, 2022
dca910a
[lab5]: test
Jun 11, 2022
e6c51e8
[lab5]: test
Jun 11, 2022
c4c40b8
[lab5]: test
Jun 11, 2022
2efcd16
[lab5]: test
Jun 11, 2022
907edd8
[lab5]: test
Jun 11, 2022
19d2004
[lab5]: test
Jun 11, 2022
03ee787
[lab5]: test
Jun 11, 2022
cdcbda4
[lab5]: test
Jun 11, 2022
2ea6ed7
[lab5]: test
Jun 11, 2022
70144ab
[lab5]: test
Jun 11, 2022
76307da
[lab5]: test
Jun 11, 2022
aa49e1f
[lab5]: test
Jun 11, 2022
a6b76ce
[lab5]: test
Jun 11, 2022
d80b488
[lab5]: test
Jun 11, 2022
6eff124
[lab5]: test
Jun 11, 2022
87f2f4c
[lab5]: test
Jun 11, 2022
0620bc5
[lab5]: test
Jun 11, 2022
a0cf9f4
[lab5]: test
Jun 11, 2022
efd6d10
[lab5]: test
Jun 11, 2022
a5a580d
[lab5]: test
Jun 11, 2022
c5201d2
[lab5]: test
Jun 11, 2022
cc3faad
[lab5]: test
Jun 11, 2022
0c0ec24
[lab5]: test
Jun 11, 2022
3e6e96d
[lab5]: test
Jun 11, 2022
5f8410a
[lab5]: test
Jun 11, 2022
d47a6b2
[lab5]: test
Jun 11, 2022
c06700e
[lab5]: change uart rx to async and tx to sync
Jun 11, 2022
fa908dc
[lab5]: change uart rx to async and tx to sync
Jun 11, 2022
f3aed8d
[lab5]: change uart rx to async and tx to sync
Jun 11, 2022
0ea388c
[lab5]: change uart rx to async and tx to sync
Jun 11, 2022
8f93d74
[lab5]: change uart rx to async and tx to sync
Jun 11, 2022
32b048b
[lab5]: change uart rx to async and tx to sync
Jun 11, 2022
37db186
[lab5]: change uart rx to async and tx to sync
Jun 11, 2022
d82bf1a
[lab5]: change uart rx to async and tx to sync
Jun 11, 2022
248091d
[lab5]: change uart rx to async and tx to sync
Jun 11, 2022
3f1e4d3
[lab5]: change uart rx to async and tx to sync
Jun 11, 2022
07df1e0
[lab5]: change uart rx to async and tx to sync
Jun 11, 2022
aee7b88
[lab5]: change uart rx to async and tx to sync
Jun 11, 2022
2c6b26f
[lab5]: change uart rx to async and tx to sync
Jun 11, 2022
1cc352e
[lab5]: change uart rx to async and tx to sync
Jun 11, 2022
620f473
[lab5]: do not add disable interrupt before schedule
Jun 11, 2022
21a375c
[lab5]: do not add disable interrupt before schedule
Jun 11, 2022
90f9b1e
[lab5]: update README
Jun 11, 2022
096d440
[lab5]: fix some bug
Jun 11, 2022
21b18b7
[lab5]: fix some bug
Jun 11, 2022
3ee5e8e
[lab5]: maybe finish basic 2
Jun 11, 2022
02cb010
[lab5]: maybe finish basic 2
Jun 11, 2022
42b9f46
[lab5]: fix some bug, lab 5 may be finished
Jun 11, 2022
702f489
[lab5]: do not add disable interrupt before schedule
Jun 11, 2022
20dbc2a
[lab5]: fix some bug
Jun 11, 2022
4b7212f
[lab5]: modify README
Jun 11, 2022
ae69de6
[lab5]: Start advance 1
Jun 12, 2022
1925a42
[lab5]: test
Jun 12, 2022
8cfcd3b
[lab5]: test for signal
Jun 12, 2022
8a448f6
[lab5]: test for signal
Jun 12, 2022
a30e11a
[lab5]: Finish lab5
Jun 12, 2022
2b28917
[lab5]: Finish lab5
Jun 12, 2022
f5622b4
[lab6]: initialize lab6 environment
Jun 16, 2022
8186e43
[lab6]: fix some bug and finish identity paging
Jun 16, 2022
b7fcd30
[lab6]: test
Jun 16, 2022
6fe01ee
[lab6]: test
Jun 16, 2022
8a35837
[lab6]: test
Jun 16, 2022
b3639ef
[lab6]: test
Jun 16, 2022
270772c
[lab6]: test
Jun 16, 2022
c03e73d
[lab6]: test
Jun 16, 2022
5895633
[lab6]: finish basic 1
Jun 16, 2022
3a3eb75
[lab6]: finish basic 1
Jun 16, 2022
88e1e47
[lab6]: tmp
Jun 16, 2022
fe764c6
[lab6]: test
Jun 17, 2022
972082a
[lab6]: finish virtual memory version's run_init_task
Jun 17, 2022
bc797bf
[lab6]: finish virtual memory version's task_exit and task_destroy
Jun 17, 2022
9239ffb
[lab6]: finish virtual memory version's task_dup and sys_mbox_call
Jun 17, 2022
f6dba76
[lab6]: finish virtual memory version's sys_exec and fix some bug
Jun 17, 2022
21ce13a
[lab6]: test
Jun 17, 2022
5f1b1b2
[lab6]: test
Jun 17, 2022
b92730f
[lab6]: finish basic 2
Jun 17, 2022
7416220
[lab6]: finish part of demand paging and fix some bug
Jun 18, 2022
be188ed
[lab6]: test
Jun 18, 2022
d55793a
[lab6]: test
Jun 19, 2022
505ad17
[lab6]: finish advance 2 and 3
Jun 19, 2022
371ff23
[lab6]: finish advance 2 and 3
Jun 19, 2022
427e8c5
[lab6]: finish lab6
Jun 20, 2022
2a992f0
[lab6]: finish lab6
Jun 20, 2022
b187557
[lab6]: finish lab6
Jun 20, 2022
a558fbf
[lab7]: Initialize lab7 develop environment
Jun 21, 2022
49a405f
[lab7]: time to sleep
Jun 22, 2022
d8b2f99
[lab7]: time to sleep
Jun 22, 2022
8a2282b
[lab7]: finsh open read write
Jun 22, 2022
ee54ed3
[lab7]: finish mkdir, time to have dinner
Jun 22, 2022
2ee0610
[lab7]: fix some bug and test
Jun 22, 2022
a9db116
[lab7]: add uartfs
Jun 22, 2022
7145382
[lab7]: finish framebuffer
Jun 23, 2022
ef7e466
[lab7]: finish framebuffer
Jun 23, 2022
654e47a
[lab7]: finish framebuffer
Jun 23, 2022
af48be3
[lab7]: finish framebuffer
Jun 23, 2022
18200c8
[lab7]: finish framebuffer
Jun 23, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
27 changes: 27 additions & 0 deletions .gdb_history
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
target remote:1234
file lab3/build/kernel8.elf
x/gx deubg
x/gx debug
b log_kernel_start
c
x/gx 0x87004
x/gx 0x87004 - 0x10
x/gx 0x87004 - 0x20
x/gx 0x87004 - 0x100
quit
target remote:1234
file ./lab3/build/kernel8.elf
x/gx 0x87004
x/gx 0x87004
watch *0x87004
c
x/gx 0x87004
quit
file
ls
file lab5/build/kernel8.elf
file 0x881e4
x/i 0x881e4
target remote:1234
x/i 0x881e4
quit
25 changes: 0 additions & 25 deletions .github/PULL_REQUEST_TEMPLATE.md

This file was deleted.

21 changes: 0 additions & 21 deletions LICENSE

This file was deleted.

23 changes: 0 additions & 23 deletions README.md

This file was deleted.

Binary file removed images/fork_button.png
Binary file not shown.
Binary file removed images/pull_request.png
Binary file not shown.
4 changes: 4 additions & 0 deletions lab0/Start.S
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.section ".text"
_start:
wfe
b _start
Binary file added lab0/Start.o
Binary file not shown.
Binary file added lab0/kernel8.elf
Binary file not shown.
1 change: 1 addition & 0 deletions lab0/kernel8.img
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
_ ����
5 changes: 5 additions & 0 deletions lab0/linker.ld
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
SECTIONS
{
. = 0x80000;
.text : { *(.text) }
}
67 changes: 67 additions & 0 deletions lab1/.gdb_history
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
file ./build/kernel8.elf
target remote :1234
ni
quit
file ./build/kernel8.elf
target remote :1234
ni
ni
ni
ni
target remote :1234
target remote :1234
ni
ni
ni
quit
file ./build/kernel8.elf
target remote :1234
ni
quit
file ./build/kernel8.elf
target remote :1234
ni
b *0x80028
c
x/gx 0x81330
b *0x80028
quit
quit
file ./build/kernel8.elf
target remote :1234
c
c
x/gx MBox_buf
x/gx MBox_write
b * 0x80360
c
mailbox
target remote :1234
b * 0x80360
del 1
c
ni
qquit
quit
file ./build/kernel8..efl
file ./build/kernel8..elf
file ./build/kernel8.elf
target remote :1234
b MBox_write
c
ni
x/gx 0x3f00b880 + 0x1b
x/gx 0x3f00b880 + 0x10
x/gx 0x3f00b880 + 0x1b
x/gx 0x3f00b880 + 0x1c
x/gx 0x3f00b880 + 0x1b
x/gx 0x3f00b880 + 0x1e
x/gx 0x3f00b880 + 0x1f
x/gx 0x3f00b880 + 0x1a
x/gx 0x3f00b880 + 0x1b
x/gx 0x3f00b880 + 0x1c
x/gx 0x3f00b880 + 0x1b
disassemble MBox_write
disassemble MBox_write
disassemble MBox_write
ls
78 changes: 78 additions & 0 deletions lab1/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
CC = aarch64-linux-gnu-gcc
CPP = aarch64-linux-gnu-cpp
override CFLAGS += \
-nostdlib \
-nodefaultlibs \
-ffreestanding \
-nostartfiles \
-mgeneral-regs-only \
-fno-builtin \

LDFLAGS ?= \
-nostdlib \

CXXFLAGS =
LD = aarch64-linux-gnu-ld
OBJCOPY = aarch64-linux-gnu-objcopy
OBJDUMP = aarch64-linux-gnu-objdump
QEMU = qemu-system-aarch64
RASPI_VER = raspi3b


LINKER_FILE = ./linker.ld
HEADERS = $(PWD)/include/
OUTPUT = $(PWD)/build
KNAME = $(OUTPUT)/kernel8

LIBS = \
$(OUTPUT)/print.o \
$(OUTPUT)/string.o \

OBJECTS = \
$(OUTPUT)/boot.o \
$(OUTPUT)/mini_uart.o \
$(OUTPUT)/mailbox.o \
$(OUTPUT)/main.o \
$(OUTPUT)/kernel_init.o \
$(OUTPUT)/reboot.o \
$(OUTPUT)/shell.o \
$(OUTPUT)/debug.o \
$(LIBS)


.PHONY: all start objects link kernel end clean dump


all: start objects link kernel end

start:
@echo "Start building kernel8.img"

objects:
$(MAKE) -C boot OUTPUT=$(OUTPUT) HEADERS=$(HEADERS) CFLAGS="$(CFLAGS)"
$(MAKE) -C peripherals OUTPUT=$(OUTPUT) HEADERS=$(HEADERS) CFLAGS="$(CFLAGS)"
$(MAKE) -C init OUTPUT=$(OUTPUT) HEADERS=$(HEADERS) CFLAGS="$(CFLAGS)"
$(MAKE) -C kernel OUTPUT=$(OUTPUT) HEADERS=$(HEADERS) CFLAGS="$(CFLAGS)"
$(MAKE) -C lib OUTPUT=$(OUTPUT) HEADERS=$(HEADERS) CFLAGS="$(CFLAGS)"
$(MAKE) -C debug OUTPUT=$(OUTPUT) HEADERS=$(HEADERS) CFLAGS="$(CFLAGS)"

link: $(OBJECTS)
$(LD) -T $(LINKER_FILE) -o $(KNAME).elf $(OBJECTS) $(LDFLAGS)

kernel: $(KNAME).elf
$(OBJCOPY) -O binary $(KNAME).elf $(KNAME).img

end:
@echo "Finish building kernel8.img"

dump:
$(OBJDUMP) -m aarch64 -b binary -D $(KNAME).img

qemu-run:
sudo $(QEMU) -M $(RASPI_VER) -kernel $(KNAME).img -display none -serial null -serial stdio

qemu-run-instr:
sudo $(QEMU) -M $(RASPI_VER) -kernel $(KNAME).img -display none -d in_asm

clean:
rm $(OUTPUT)/*
18 changes: 18 additions & 0 deletions lab1/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Requirements

## Features

- Basic Exercise 1
- [x] All it’s data is presented at correct memory address. (In linker.ld)
- [x] The program counter is set to correct memory address. (In linker.ld)
- [x] The bss segment are initialized to 0. (In boot/boot.S)
- [x] The stack pointer is set to a proper address. (In boot/boot.S)
- Basic Exercise 2
- [x] Mini UART (In peripherals/mini_uart.c)
- Basic Exercise 3
- [x] Simple Shell (In kernel/shell.c)
- Basic Exercise 4
- [x] Mailbox (In peripherals/mailbox.c)
- Advanced Exercise 1
- [x] Reboot (In kernel/reboot.c)

23 changes: 23 additions & 0 deletions lab1/boot/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
CC = aarch64-linux-gnu-gcc
CPP = aarch64-linux-gnu-cpp
CFLAGS ?= \
-nostdlib \
-nodefaultlibs \
-ffreestanding \
-nostartfiles \
-mgeneral-regs-only \
-fno-builtin

CXXFLAGS =

OUTPUT ?= .
OBJECTS = \
boot.o

all: $(OBJECTS)

%.o: %.S
$(CC) -c $^ -o $(OUTPUT)/$@

clean:
rm $(OUTPUT)/$(OBJECTS)
32 changes: 32 additions & 0 deletions lab1/boot/boot.S
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
.section ".text.boot"
.global _start
_start:
// read cpu id, stop slave cores
mrs x1, mpidr_el1
and x1, x1, #0xff

// cpu id > 0, stop
cbz x1, master_core

proc_hang:
wfe
b proc_hang

// cpu id == 0
master_core:
// stack
adr x1, _start
mov sp, x1
// initialize .bss section
ldr x1, =__bss_start
ldr x2, =__bss_end
bss_zero:
sub x3, x2, x1
cbz x3, end
str xzr, [x1], #8 // store zero to [x1] and add 8 to x1
b bss_zero

end:
// jump to kernel_main
bl kernel_main
b proc_hang
Binary file added lab1/build/boot.o
Binary file not shown.
Binary file added lab1/build/debug.o
Binary file not shown.
Binary file added lab1/build/kernel8.elf
Binary file not shown.
Binary file added lab1/build/kernel8.img
Binary file not shown.
Binary file added lab1/build/kernel_init.o
Binary file not shown.
Binary file added lab1/build/mailbox.o
Binary file not shown.
Binary file added lab1/build/main.o
Binary file not shown.
Binary file added lab1/build/mini_uart.o
Binary file not shown.
Binary file added lab1/build/print.o
Binary file not shown.
Binary file added lab1/build/reboot.o
Binary file not shown.
Binary file added lab1/build/shell.o
Binary file not shown.
Binary file added lab1/build/string.o
Binary file not shown.
3 changes: 3 additions & 0 deletions lab1/debug.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/sh
make CFLAGS=-DDEBUG >/dev/null
make qemu-run
26 changes: 26 additions & 0 deletions lab1/debug/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
CC = aarch64-linux-gnu-gcc
CPP = aarch64-linux-gnu-cpp
CFLAGS ?= \
-nostdlib \
-nodefaultlibs \
-ffreestanding \
-nostartfiles \
-mgeneral-regs-only \
-fno-builtin

CXXFLAGS =

OUTPUT ?= .
HEADERS ?= ../include
LIBS = \
debug.o

all: $(LIBS)

%.o: %.c
$(CC) -c $(CFLAGS) -o $(OUTPUT)/$@ $^ -I$(HEADERS)



clean:
rm $(OUTPUT)/$(LIBS)
Loading