From 3127a209c2dba3a6aa25a4582ff4a240ad175a6b Mon Sep 17 00:00:00 2001 From: BrianLiu <125264650+brianLiu0405@users.noreply.github.com> Date: Wed, 28 Feb 2024 15:05:04 +0800 Subject: [PATCH 01/10] Update README.org modify 2023 -> 2024 --- README.org | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.org b/README.org index a77151714..cf4f47a15 100644 --- a/README.org +++ b/README.org @@ -1,4 +1,4 @@ -#+TITLE: Operating Systems Capstone 2023 +#+TITLE: Operating Systems Capstone 2024 #+OPTIONS: toc:nil This repository is used for homework submission. @@ -37,7 +37,7 @@ If you cannot find your branch, ask TAs for help. #+BEGIN_SRC shell git clone - cd osc2023 + cd osc2024 git checkout --track origin/ #+END_SRC From 32d53878c3c41df7a677f1a41c7a52d64391a4db Mon Sep 17 00:00:00 2001 From: arthur Date: Wed, 6 Mar 2024 19:37:08 +0800 Subject: [PATCH 02/10] modify the readme --- README.org | 87 ++++++++++-------------------------------------------- 1 file changed, 15 insertions(+), 72 deletions(-) diff --git a/README.org b/README.org index cf4f47a15..a0cfbf2fa 100644 --- a/README.org +++ b/README.org @@ -1,79 +1,22 @@ -#+TITLE: Operating Systems Capstone 2024 -#+OPTIONS: toc:nil +# OSC2023 -This repository is used for homework submission. +| Github Account | Student ID | Name | +|----------------|------------|---------------| +| psychicalcoder | 0816171 | Tsung-Han Liu | -*To protect your rights, please create a pull request (PR) before the demo and* -*make sure the TA merges your PR after the demo.* +## Requirements -* How To Submit Homework +* a cross-compiler for aarch64 +* (optional) qemu-system-arm -** Overview -For those who are familiar with git. -1. TA creates a branch named your student ID. -2. You fork this repo. -3. Base on the == branch, you do your labs and put your code in the - forked repo. -4. Create a PR to the == branch in this repo to submit the homework. -5. TA merges the PR as a proof that you have demo the lab. +## Build -** Fork The Repo -Fork the repository on Github. +``` +make kernel.img +``` -[[./images/fork_button.jpg]] +## Test With QEMU -Uncheck the "Copy the =main= branch only". - -[[./images/create_fork.jpg]] - -If you don't want to see a lot of redundant branches in the forked repo, keep -the checkbox checked and follow the [[./git-usage.org][guide]] to fetch your own branch. - -** Clone To Your Computer -Clone the forked repo and switch to the branch named your student id. -If you cannot find your branch, ask TAs for help. - -[[./images/clone_url.jpg]] - -#+BEGIN_SRC shell - git clone - cd osc2024 - git checkout --track origin/ -#+END_SRC - -** Specify Personal Information -Write down the following info in your =README.md= (or =README.org=, =README.rst= -etc.) -+ Github account name -+ Student ID -+ Your name -+ Any other information you want - -Here is an example [[https://github.com/psychicalcoder/osc2023/blob/0816171/README.md][README.md]]. - -** Implement Your Kernel -Design and implement your kernel in the forked repository. -#+BEGIN_QUOTE - Make good use of =.gitignore=. In the git history, we do not want to see - binaries, objective files, __MACOSX, python caches, super large test files, - or any files that can be compiled from your source code. -#+END_QUOTE - -** Create a PR -Create a Github pull request before your demo. Once the PR is created, you can -always push additional commits to your forked repo before the PR is merged. The -changes will automatically appear within the PR. - -1. Click the =New pull request= buttom in your repo. - [[./images/pr_button.jpg]] -2. Choose the branch with your student ID as the base branch. - [[./images/pr_base_selection.jpg]] -3. Type a title and some information about the PR. - [[./images/pr_desc.jpg]] - -Here is a [[https://github.com/oscapstone/osc2023/pull/1][PR example]]. - -* Happy Coding ~ -As long as you meet the above requirements and the PR can be merged without -conflicts, we do not care about what the forked repo look like. You can rename -your branch, change the default branch, or do whatever you want. +``` +qemu-system-aarch64 -M raspi3b -kernel kernel.img -initrd initramfs.cpio -serial null -serial stdio -dtb bcm2710-rpi-3-b-plus.dtb +``` \ No newline at end of file From ab89623a39e96b42d57119f924fa2a68e1894aba Mon Sep 17 00:00:00 2001 From: arthur Date: Thu, 7 Mar 2024 10:59:34 +0800 Subject: [PATCH 03/10] finish Mailbox board revision --- lab1/Makefile | 141 ++++++++++++++++++++++++++++++++++++++ lab1/boot.S | 30 ++++++++ lab1/boot.o | Bin 0 -> 1216 bytes lab1/lib/include/aux.h | 33 +++++++++ lab1/lib/include/gpio.h | 35 ++++++++++ lab1/lib/include/mbox.h | 109 +++++++++++++++++++++++++++++ lab1/lib/include/mmio.h | 14 ++++ lab1/lib/include/shell.h | 31 +++++++++ lab1/lib/include/stdint.h | 13 ++++ lab1/lib/include/string.h | 20 ++++++ lab1/lib/include/uart.h | 19 +++++ lab1/lib/mbox.c | 39 +++++++++++ lab1/lib/mmio.c | 11 +++ lab1/lib/shell.c | 102 +++++++++++++++++++++++++++ lab1/lib/uart.c | 102 +++++++++++++++++++++++++++ lab1/linker.ld | 48 +++++++++++++ lab1/main.c | 10 +++ lab1/main.o | Bin 0 -> 1656 bytes 18 files changed, 757 insertions(+) create mode 100644 lab1/Makefile create mode 100644 lab1/boot.S create mode 100644 lab1/boot.o create mode 100644 lab1/lib/include/aux.h create mode 100644 lab1/lib/include/gpio.h create mode 100644 lab1/lib/include/mbox.h create mode 100644 lab1/lib/include/mmio.h create mode 100644 lab1/lib/include/shell.h create mode 100644 lab1/lib/include/stdint.h create mode 100644 lab1/lib/include/string.h create mode 100644 lab1/lib/include/uart.h create mode 100644 lab1/lib/mbox.c create mode 100644 lab1/lib/mmio.c create mode 100644 lab1/lib/shell.c create mode 100644 lab1/lib/uart.c create mode 100644 lab1/linker.ld create mode 100644 lab1/main.c create mode 100644 lab1/main.o diff --git a/lab1/Makefile b/lab1/Makefile new file mode 100644 index 000000000..9b832051b --- /dev/null +++ b/lab1/Makefile @@ -0,0 +1,141 @@ +BUILD_DIR = ./build +# Lib +LIB_SRC_DIR = ./lib + +# LIB_SRC = \ +# $(LIB_SRC_DIR)/mbox.c \ +# $(LIB_SRC_DIR)/mmio.c \ +# $(LIB_SRC_DIR)/shell.c \ +# $(LIB_SRC_DIR)/string.c \ +# $(LIB_SRC_DIR)/uart.c \ +# $(LIB_SRC_DIR)/utils.c \ + +LIB_SRC = \ + $(LIB_SRC_DIR)/mmio.c \ + $(LIB_SRC_DIR)/mbox.c \ + $(LIB_SRC_DIR)/shell.c \ + $(LIB_SRC_DIR)/uart.c \ + +LIB_INCLUDES = \ + -I $(LIB_SRC_DIR)/include \ + +LIB_BUILD_DIR = $(BUILD_DIR)/lib +LIB_OBJS := $(patsubst %.c,$(LIB_BUILD_DIR)/%.o,$(notdir $(LIB_SRC))) + +# Application +APP_SRC_DIR = . + +APP_SRC = \ + $(APP_SRC_DIR)/main.c \ + +APP_ASM = \ + $(APP_SRC_DIR)/boot.S \ + +APP_INCLUDES = \ + -I ./ \ + $(LIB_INCLUDES) \ + +APP_BUILD_DIR = $(BUILD_DIR)/app +APP_OBJS := $(patsubst %.c,$(APP_BUILD_DIR)/%.o,$(notdir $(APP_SRC))) +APP_OBJS += $(patsubst %.S,$(APP_BUILD_DIR)/%.o,$(notdir $(APP_ASM))) + +VPATH += \ + $(LIB_SRC_DIR) \ + $(APP_SRC_DIR) \ + +# ARM toolchain +CROSS = aarch64-linux-gnu +CC = $(CROSS)-gcc +AS = $(CROSS)-as +LD = $(CROSS)-ld +OC = $(CROSS)-objcopy +OD = $(CROSS)-objdump +SP = $(CROSS)-strip + +# Project +OUT_OBJS = \ + $(LIB_OBJS) \ + $(APP_OBJS) \ + +BUILD_DIRECTORIES = \ + $(LIB_BUILD_DIR) \ + $(APP_BUILD_DIR) \ + +PROJ = kernel8 +OUT_ELF = ./$(PROJ).elf +OUT_IMG = ./$(PROJ).img +LINKER_FILE = linker.ld + +CCFLAGS = -Wall -O0 -fno-stack-protector +LDFLAGS = -T$(LINKER_FILE) -nostdlib + +.PHONY: clean directories out_elf run docker_cp +all: directories $(OUT_OBJS) $(OUT_ELF) $(OUT_IMG) +directories: $(BUILD_DIRECTORIES) +out_elf: directories $(OUT_ELF) +out_img: directories $(OUT_IMG) + +# Compile Object Files --------------------------------------------------------- +$(APP_BUILD_DIR)/%.o : %.c + @echo '============================================================' + @echo ' Building target: $@' + @echo '============================================================' + @echo "[+] Building: $<" + $(CC) $(CCFLAGS) $(APP_INCLUDES) -g -o $@ -c $< + @echo "[+] Finished Building: $<" + @echo '' + +$(APP_BUILD_DIR)/%.o : %.S + @echo '============================================================' + @echo ' Building target: $@' + @echo '============================================================' + @echo "[+] Building: $<" + $(CC) $(ASMFLAGS) $(APP_INCLUDES) -g -o $@ -c $< + @echo "[+] Finished Building: $<" + @echo '' + +$(LIB_BUILD_DIR)/%.o : %.c + @echo '============================================================' + @echo ' Building target: $@' + @echo '============================================================' + @echo "[+] Building: $<" + $(CC) $(CCFLAGS) $(LIB_INCLUDES) -g -o $@ -c $< + @echo "[+] Finished Building: $<" + @echo '' + +# Generate ELF ----------------------------------------------------------------- +$(OUT_ELF): $(OUT_OBJS) + @echo '============================================================' + @echo ' Building target: $@' + @echo '============================================================' + $(LD) $(LDFLAGS) -o $@ $(OUT_OBJS) + $(OD) -d $@ > $(BUILD_DIR)/$(PROJ).objdump + # $(SP) $@ + @echo '[+] Finished building target: $@' + @echo ' ' + +# Generate IMG ----------------------------------------------------------------- +$(OUT_IMG): $(OUT_ELF) + @echo '============================================================' + @echo ' Building target: $@' + @echo '============================================================' + $(OC) -O binary $(OUT_ELF) $@ + @echo '[+] Finished building target: $@' + @echo ' ' + +$(BUILD_DIRECTORIES): + mkdir -p $@ + +run: + qemu-system-aarch64 -M raspi3b -kernel kernel8.img -display none -serial null -serial stdio + +debug: + qemu-system-aarch64 -M raspi3b -kernel kernel8.img -display none -serial null -serial stdio -s -S + +docker_cp: + docker cp kernel8.elf my_kali:/ + +clean: + rm -rf *.elf + rm -rf *.img + rm -rf $(BUILD_DIR) \ No newline at end of file diff --git a/lab1/boot.S b/lab1/boot.S new file mode 100644 index 000000000..633875f8a --- /dev/null +++ b/lab1/boot.S @@ -0,0 +1,30 @@ +.section ".text.boot" + +.global _start + +_start: + // read cpu id, stop slave cores + mrs x1, mpidr_el1 + and x1, x1, #3 + cbz x1, 2f + // cpu id > 0, stop +1: wfe + b 1b +2: // cpu id == 0 + + // set top of stack just before our code (stack grows to a lower address per AAPCS64) + ldr x1, =_start + mov sp, x1 + + // clear bss + ldr x1, =__bss_start + ldr w2, =__bss_size +3: cbz w2, 4f + str xzr, [x1], #8 + sub w2, w2, #1 + cbnz w2, 3b + + // jump to C code, should not return +4: bl kernel_main + // for failsafe, halt this core too + b 1b \ No newline at end of file diff --git a/lab1/boot.o b/lab1/boot.o new file mode 100644 index 0000000000000000000000000000000000000000..605353a83c440cb605a6b38d1e2913ac4a3fbe8c GIT binary patch literal 1216 zcmbW0&q~8U5XQeWL0k2pc(72A77Bt$K&aqB=prZ{Jm}3^+|q!>{(&Ti>O~PBK*bl( zC-5NnB)yC8Ab5*2?XF$6DM$yx%=~t~>1;E(IXFJdIS#Zr_`o>R6u8ZeV=)W`3drLH zyMu}+o+R)dl-)s^rfbr{Ssi#}{{g|U(z!H}3eq$jzJ#aA6E* zv~uYr%UpO9cy#AUJ|Z6WEQRL6;!Bh-XY`*Ra;uoq)hT>^3P-h%Y7;@wh~pqmWR&Q* zbsgd|jJjbv=*U)A{Zvi)5?ydn#q9Kba>N%5E>z4bkvI5}!3ze5A76D6*&v@pBY&Zz zB6UmFtviO{-AC%-$4X78$Xv-=H)8 zpJvr>la_l}0eX2pv73BV0r}ag}xh(7Jc~IwN)ra?&wYHvj d!M;07-;{2X6T=k#BP$eT>4h3f@2M8p`d^tlLjwQ+ literal 0 HcmV?d00001 diff --git a/lab1/lib/include/aux.h b/lab1/lib/include/aux.h new file mode 100644 index 000000000..7fca3f1ec --- /dev/null +++ b/lab1/lib/include/aux.h @@ -0,0 +1,33 @@ +#ifndef __AUX_H__ +#define __AUX_H__ + +#include "mmio.h" +/* Ref: https://cs140e.sergio.bz/docs/BCM2837-ARM-Peripherals.pdf + * Page: 8 +*/ +#define AUX_BASE (MMIO_BASE + 0x00215000) +#define AUX_IRQ (AUX_BASE + 0x0) +#define AUX_ENABLES (AUX_BASE + 0x4) +#define AUX_MU_IO_REG (AUX_BASE + 0x40) +#define AUX_MU_IER_REG (AUX_BASE + 0x44) +#define AUX_MU_IIR_REG (AUX_BASE + 0x48) +#define AUX_MU_LCR_REG (AUX_BASE + 0x4c) +#define AUX_MU_MCR_REG (AUX_BASE + 0x50) +#define AUX_MU_LSR_REG (AUX_BASE + 0x54) +#define AUX_MU_MSR_REG (AUX_BASE + 0x58) +#define AUX_MU_SCRATCH (AUX_BASE + 0x5c) +#define AUX_MU_CNTL_REG (AUX_BASE + 0x60) +#define AUX_MU_STAT_REG (AUX_BASE + 0x64) +#define AUX_MU_BAUD_REG (AUX_BASE + 0x68) +#define AUX_SPI0_CNTL0_REG (AUX_BASE + 0x80) +#define AUX_SPI0_CNTL1_REG (AUX_BASE + 0x84) +#define AUX_SPI0_STAT_REG (AUX_BASE + 0x88) +#define AUX_SPI0_IO_REG (AUX_BASE + 0x90) +#define AUX_SPI0_PEEK_REG (AUX_BASE + 0x94) +#define AUX_SPI1_CNTL0_REG (AUX_BASE + 0xc0) +#define AUX_SPI1_CNTL1_REG (AUX_BASE + 0xc4) +#define AUX_SPI1_STAT_REG (AUX_BASE + 0xc8) +#define AUX_SPI1_IO_REG (AUX_BASE + 0xd0) +#define AUX_SPI1_PEEK_REG (AUX_BASE + 0xd4) + +#endif \ No newline at end of file diff --git a/lab1/lib/include/gpio.h b/lab1/lib/include/gpio.h new file mode 100644 index 000000000..b4322f8db --- /dev/null +++ b/lab1/lib/include/gpio.h @@ -0,0 +1,35 @@ +#ifndef __GPIO_H__ +#define __GPIO_H__ + +#define GPIO_BASE 0x3f200000 +#define GPFSEL0 (GPIO_BASE + 0x0) +#define GPFSEL1 (GPIO_BASE + 0x4) +#define GPFSEL2 (GPIO_BASE + 0x8) +#define GPFSEL3 (GPIO_BASE + 0xc) +#define GPFSEL4 (GPIO_BASE + 0x10) +#define GPFSEL5 (GPIO_BASE + 0x14) +#define GPSET0 (GPIO_BASE + 0x1c) +#define GPSET1 (GPIO_BASE + 0x20) +#define GPCLR0 (GPIO_BASE + 0x28) +#define GPCLR1 (GPIO_BASE + 0x2c) +#define GPLEV0 (GPIO_BASE + 0x34) +#define GPLEV1 (GPIO_BASE + 0x38) +#define GPEDS0 (GPIO_BASE + 0x40) +#define GPEDS1 (GPIO_BASE + 0x44) +#define GPREN0 (GPIO_BASE + 0x4c) +#define GPREN1 (GPIO_BASE + 0x50) +#define GPFEN0 (GPIO_BASE + 0x58) +#define GPFEN1 (GPIO_BASE + 0x5c) +#define GPHEN0 (GPIO_BASE + 0x64) +#define GPHEN1 (GPIO_BASE + 0x68) +#define GPLEN0 (GPIO_BASE + 0x70) +#define GPLEN1 (GPIO_BASE + 0x74) +#define GPAREN0 (GPIO_BASE + 0x7c) +#define GPAREN1 (GPIO_BASE + 0x80) +#define GPAFEN0 (GPIO_BASE + 0x88) +#define GPAFEN1 (GPIO_BASE + 0x8c) +#define GPPUD (GPIO_BASE + 0x94) +#define GPPUDCLK0 (GPIO_BASE + 0x98) +#define GPPUDCLK1 (GPIO_BASE + 0x9c) + +#endif \ No newline at end of file diff --git a/lab1/lib/include/mbox.h b/lab1/lib/include/mbox.h new file mode 100644 index 000000000..67ea2f922 --- /dev/null +++ b/lab1/lib/include/mbox.h @@ -0,0 +1,109 @@ +#ifndef __MBOX_H__ +#define __MBOX_H__ + +#include "mmio.h" + +#define VIDEOCORE_MBOX_BASE (MMIO_BASE + 0x0000B880) +#define MBOX_READ (VIDEOCORE_MBOX_BASE + 0x00) +#define MBOX_POLL (VIDEOCORE_MBOX_BASE + 0x10) +#define MBOX_SENDER (VIDEOCORE_MBOX_BASE + 0x14) +#define MBOX_STATUS (VIDEOCORE_MBOX_BASE + 0x18) +#define MBOX_CONFIG (VIDEOCORE_MBOX_BASE + 0x1C) +#define MBOX_WRITE (VIDEOCORE_MBOX_BASE + 0x20) +#define MBOX_RESPONSE (0x80000000) +#define MBOX_FULL (0x80000000) +#define MBOX_EMPTY (0x40000000) + +#define MBOX_CH_POWER (0) +#define MBOX_CH_FB (1) +#define MBOX_CH_VUART (2) +#define MBOX_CH_VCHIQ (3) +#define MBOX_CH_LEDS (4) +#define MBOX_CH_BTNS (5) +#define MBOX_CH_TOUCH (6) +#define MBOX_CH_COUNT (7) +#define MBOX_CH_PROP (8) + +#define MAIL_BODY_BUF_LEN (4) +#define MAIL_BUF_SIZE (MAIL_BODY_BUF_LEN << 2) +#define MAIL_PACKET_SIZE (MAIL_BUF_SIZE + 24) + +#define REQUEST_CODE 0x00000000 +#define REQUEST_SUCCEED 0x80000000 +#define REQUEST_FAILED 0x80000001 +#define TAG_REQUEST_CODE 0x00000000 +#define END_TAG 0x00000000 + +/* Tags */ +#define GET_FIRMWARE_REVISION 0x00000001 +#define GET_BOARD_MODEL 0x00010001 +#define GET_BOARD_REVISION 0x00010002 +#define GET_BOARD_MAC_ADDR 0x00010003 +#define GET_BOARD_SERIAL 0x00010004 +#define GET_ARM_MEMORY 0x00010005 +#define GET_VC_MEMORY 0x00010006 +#define GET_CLOCKS 0x00010007 + +#define GET_COMMAND_LINE 0x00050001 + +#define GET_DMA_CHANNELS 0x00060001 + +#define GET_POWER_STATE 0x00020001 +#define GET_TIMING 0x00020002 +#define SET_POWER_STATE 0x00028001 + +// and so on... + +/* Unique Device ID */ +#define DEVICE_ID_SD_CARD 0x00000000 +#define DEVICE_ID_UART0 0x00000001 +#define DEVICE_ID_UART1 0x00000002 +#define DEVICE_ID_USB_HCD 0x00000003 +#define DEVICE_ID_I2C0 0x00000004 +#define DEVICE_ID_I2C1 0x00000005 +#define DEVICE_ID_I2C2 0x00000006 +#define DEVICE_ID_SPI 0x00000007 +#define DEVICE_ID_CCP2TX 0x00000008 +#define DEVICE_ID_UNKNOWN 0x00000009 +#define DEVICE_ID_UNKNOWN 0x0000000a + +/* Unique Clock ID */ +#define CLOCK_ID_RESERVED 0x000000000 +#define CLOCK_ID_EMMC 0x000000001 +#define CLOCK_ID_UART 0x000000002 +#define CLOCK_ID_ARM 0x000000003 +#define CLOCK_ID_CORE 0x000000004 +#define CLOCK_ID_V3D 0x000000005 +#define CLOCK_ID_H264 0x000000006 +#define CLOCK_ID_ISP 0x000000007 +#define CLOCK_ID_SDRAM 0x000000008 +#define CLOCK_ID_PIXEL 0x000000009 +#define CLOCK_ID_PWM 0x00000000a +#define CLOCK_ID_HEVC 0x00000000b +#define CLOCK_ID_EMMC2 0x00000000c +#define CLOCK_ID_M2MC 0x00000000d +#define CLOCK_ID_PIXEL_BVB 0x00000000e + +struct mail_header { + uint32_t packet_size; + uint32_t code; +}; + +struct mail_body { + uint32_t id; + uint32_t buf_size; + uint32_t code; + uint32_t buf[MAIL_BODY_BUF_LEN]; + uint32_t end; +}; + +typedef struct mail_t { + struct mail_header header; + struct mail_body body; +} mail_t __attribute__((aligned(16))); + +int mbox_call(mail_t* mbox, uint8_t ch); +void get_board_revision(uint32_t* board_revision); + + +#endif \ No newline at end of file diff --git a/lab1/lib/include/mmio.h b/lab1/lib/include/mmio.h new file mode 100644 index 000000000..efbccf3c9 --- /dev/null +++ b/lab1/lib/include/mmio.h @@ -0,0 +1,14 @@ +#ifndef __MMIO_H__ +#define __MMIO_H__ +// #include +#include "stdint.h" + +#define PHY_BASE 0x3F000000 +#define BUS_BASE 0x7f000000 + +#define MMIO_BASE PHY_BASE + +void mmio_write(uint32_t reg, uint32_t data); // MMIO write +uint32_t mmio_read(uint32_t reg); // MMIO read + +#endif \ No newline at end of file diff --git a/lab1/lib/include/shell.h b/lab1/lib/include/shell.h new file mode 100644 index 000000000..453676ae1 --- /dev/null +++ b/lab1/lib/include/shell.h @@ -0,0 +1,31 @@ +#ifndef __SHELL_H__ +#define __SHELL_H__ +#include "mbox.h" +#include "stdint.h" +#include "string.h" +// #include "uart.h" + +struct func { + char *name; + void (*ptr)(); + char *desc; +}; + +void welcome_msg(); +void shell(); +void read_cmd(); +void exec_cmd(); + +void cmd_help(); +void cmd_hello(); +//void cmd_reboot(); +void cmd_sysinfo(); +void cmd_unknown(); + +struct func func_list[] = { + {.name = "help", .ptr = cmd_help, .desc = "print this help menu"}, + {.name = "hello", .ptr = cmd_hello, .desc = "print Hello World!"}, + {.name = "reboot", .ptr = cmd_help, .desc = "reboot the device"}, + {.name = "sysinfo", .ptr = cmd_sysinfo, .desc = "get system info"}}; + +#endif \ No newline at end of file diff --git a/lab1/lib/include/stdint.h b/lab1/lib/include/stdint.h new file mode 100644 index 000000000..4b76cee21 --- /dev/null +++ b/lab1/lib/include/stdint.h @@ -0,0 +1,13 @@ +#ifndef __STDINT_H__ +#define __STDINT_H__ + +#define int8_t signed char +#define int16_t signed short int +#define int32_t signed int +#define int64_t signed long int +#define uint8_t unsigned char +#define uint16_t unsigned short int +#define uint32_t unsigned int +#define uint64_t unsigned long int + +#endif \ No newline at end of file diff --git a/lab1/lib/include/string.h b/lab1/lib/include/string.h new file mode 100644 index 000000000..fde569986 --- /dev/null +++ b/lab1/lib/include/string.h @@ -0,0 +1,20 @@ +#ifndef __STRING_H__ +#define __STRING_H__ + +#include "stdint.h" + +#define ENDL "\r\n" + +int strcmp(const char *a, const char *b) { + uint32_t i = 0; + while (a[i] == b[i] && a[i] != '\0' && b[i] != '\0') i++; + return a[i] - b[i]; +} + +uint32_t strlen(const char *a) { + for (uint32_t i = 0;; i++) + if (a[i] == '\0') return i; + return 0; +} + +#endif \ No newline at end of file diff --git a/lab1/lib/include/uart.h b/lab1/lib/include/uart.h new file mode 100644 index 000000000..a5e3b59c0 --- /dev/null +++ b/lab1/lib/include/uart.h @@ -0,0 +1,19 @@ +#ifndef __UART_H__ +#define __UART_H__ + +#include "aux.h" +#include "gpio.h" +#include "mmio.h" + +void uart_init(); +void uart_write(char c); +char uart_read(); +void uart_flush(); +void uart_write_string(char* str); +void uart_puth(uint32_t d); +void delay(uint32_t t) { + for (uint32_t i = 0; i < t; i++) + asm volatile("nop"); +} + +#endif \ No newline at end of file diff --git a/lab1/lib/mbox.c b/lab1/lib/mbox.c new file mode 100644 index 000000000..b20c3ec7f --- /dev/null +++ b/lab1/lib/mbox.c @@ -0,0 +1,39 @@ +#include "mbox.h" + +int mbox_call(mail_t* mbox, uint8_t ch) { + uint32_t addr_channel; + + // 1. Read the status register until the empty flag is not set + while (mmio_read(MBOX_STATUS) & MBOX_FULL) asm volatile("nop"); + + // 2. Write the data (shifted into the uppper 28 bits) combined with + // the channel (in the lower four bits) to the write register + addr_channel = (((uint32_t)(uint64_t)mbox) & 0xFFFFFFF0) | (ch & 0xF); + mmio_write(MBOX_WRITE, addr_channel); + + // Wait for mbox response + do { + while (mmio_read(MBOX_STATUS) & MBOX_EMPTY) asm volatile("nop"); + } while (mmio_read(MBOX_READ) != addr_channel); + + /* check response vaild */ + return mbox->header.code == MBOX_RESPONSE; +} + +void get_board_revision(uint32_t* board_revision) { + mail_t mbox = { + .header.packet_size = MAIL_PACKET_SIZE, + .header.code = REQUEST_CODE, + .body.id = GET_BOARD_REVISION, + .body.buf_size = MAIL_BUF_SIZE, + .body.code = TAG_REQUEST_CODE, + .body.end = END_TAG, + }; + + for (uint32_t i = 0; i < MAIL_BODY_BUF_LEN; i++) mbox.body.buf[i] = 0; + + mbox_call(&mbox, MBOX_CH_PROP); + + *board_revision = mbox.body.buf[0]; +} + diff --git a/lab1/lib/mmio.c b/lab1/lib/mmio.c new file mode 100644 index 000000000..ef9ba0d36 --- /dev/null +++ b/lab1/lib/mmio.c @@ -0,0 +1,11 @@ +#include "mmio.h" + +#include "stdint.h" + +void mmio_write(uint32_t reg, uint32_t data) { + *(volatile uint32_t*)(reg) = data; +} + +uint32_t mmio_read(uint32_t reg) { + return *(volatile uint32_t*)(reg); +} diff --git a/lab1/lib/shell.c b/lab1/lib/shell.c new file mode 100644 index 000000000..711c78ebd --- /dev/null +++ b/lab1/lib/shell.c @@ -0,0 +1,102 @@ +#include "shell.h" + +char buf[0x100]; + +void welcome_msg() { + uart_write_string( + ENDL + " ____ _____ _____ ___ ___ ___ _ _" ENDL + " / __ \\ / ____| / ____| |__ \\ / _ \\ |__ \\ | || |" ENDL + " | | | || (___ | | ) || | | | ) || || |_" ENDL + " | | | | \\___ \\ | | / / | | | | / / |__ _|" ENDL + " | |__| | ____) || |____ / /_ | |_| | / /_ | | "ENDL + " \\____/ |_____/ \\_____| |____| \\___/ |____| |_|" ENDL); + + + +} + +void read_cmd() { + char tmp; + uart_write_string("# "); + for (uint32_t i = 0; tmp = uart_read();) { + uart_write(tmp); + switch (tmp) { + case '\r': + case '\n': + buf[i++] = '\0'; + return; + case 127: // Backspace + if (i > 0) { + i--; + buf[i] = '\0'; + uart_write_string("\b \b"); + } + break; + default: + buf[i++] = tmp; + break; + } + } +} + +void exec_cmd() { + if (!strlen(buf)) return; + for (uint32_t i = 0; i < sizeof(func_list) / sizeof(struct func); i++) { + if (!strcmp(buf, func_list[i].name)) { + func_list[i].ptr(); + return; + } + } + cmd_unknown(); +} + +void cmd_help() { + for (uint32_t i = 0; i < sizeof(func_list) / sizeof(struct func); i++) { + uart_write_string(func_list[i].name); + for (uint32_t j = 0; j < (10 - strlen(func_list[i].name)); j++) uart_write(' '); + uart_write_string(": "); + uart_write_string(func_list[i].desc); + uart_write_string(ENDL); + } +} + +void cmd_hello() { + uart_write_string("Hello World!" ENDL); +} + + + +void cmd_sysinfo() { + uint32_t *board_revision; + uint32_t *board_serial_msb, *board_serial_lsb; + uint32_t *mem_base, *mem_size; + const int padding = 20; + + // Board Revision + get_board_revision(board_revision); + uart_write_string("Board Revision : 0x"); + uart_puth(*board_revision); + uart_write_string(ENDL); + + +} + +void cmd_unknown() { + uart_write_string("Unknown command: "); + uart_write_string(buf); + uart_write_string(ENDL); +} + +void shell() { + welcome_msg(); + do { + read_cmd(); + + uart_write_string("# "); + uart_write_string(buf); + uart_write_string(ENDL); + + exec_cmd(); + } while (1); +} \ No newline at end of file diff --git a/lab1/lib/uart.c b/lab1/lib/uart.c new file mode 100644 index 000000000..d8012962e --- /dev/null +++ b/lab1/lib/uart.c @@ -0,0 +1,102 @@ +#include "uart.h" + +#include "mmio.h" +// #include "stdint.h" + +void uart_init() { + uint32_t t; + + /* Init GPIO */ + // mini UART -> set ALT5, PL011 UART -> set ALT0 + // Configure GPFSELn register to change alternate function + t = mmio_read(GPFSEL1); + t &= ~(7 << 12); // clean gpio14 + t |= (2 << 12); // set alt5 + t &= ~(7 << 15); // clean gpio15 + t |= (2 << 15); // set alt5 + mmio_write(GPFSEL1, t); + + /* Configure pull up/down register to disable GPIO pull up/down */ + /* + The GPIO Pull-up/down Clock Registers control the actuation of internal pull-downs on + the respective GPIO pins. These registers must be used in conjunction with the GPPUD + register to effect GPIO Pull-up/down changes. The following sequence of events is + required: + 1. Write to GPPUD to set the required control signal (i.e. Pull-up or Pull-Down or neither + to remove the current Pull-up/down) + 2. Wait 150 cycles – this provides the required set-up time for the control signal + 3. Write to GPPUDCLK0/1 to clock the control signal into the GPIO pads you wish to + modify – NOTE only the pads which receive a clock will be modified, all others will + retain their previous state. + 4. Wait 150 cycles – this provides the required hold time for the control signal + 5. Write to GPPUD to remove the control signal + 6. Write to GPPUDCLK0/1 to remove the clock + */ + mmio_write(GPPUD, 0); + delay(150); + mmio_write(GPPUDCLK0, (1 << 14) | (1 << 15)); + delay(150); + mmio_write(GPPUDCLK0, 0); + + /* Init mini UART */ + // 0. The MMIO area base address is 0x3F000000 on raspi3 + // 1. Set AUXENB register to enable mini UART. Then mini UART register can be accessed. + t = mmio_read(AUX_ENABLES); + mmio_write(AUX_ENABLES, t | 1); + + // 2. Set AUX_MU_CNTL_REG to 0. Disable transmitter and receiver during configuration. + mmio_write(AUX_MU_CNTL_REG, 0); + + // 3. Set AUX_MU_IER_REG to 0. Disable interrupt because currently you don’t need interrupt. + mmio_write(AUX_MU_IER_REG, 0); + + // 4. Set AUX_MU_LCR_REG to 3. Set the data size to 8 bit. + mmio_write(AUX_MU_LCR_REG, 3); + + // 5. Set AUX_MU_MCR_REG to 0. Don’t need auto flow control. + mmio_write(AUX_MU_MCR_REG, 0); + + // 6. Set AUX_MU_BAUD to 270. Set baud rate to 115200 + mmio_write(AUX_MU_BAUD_REG, 270); + + // 7. Set AUX_MU_IIR_REG to 6. No FIFO. + mmio_write(AUX_MU_IIR_REG, 6); + + // 8. Set AUX_MU_CNTL_REG to 3. Enable the transmitter and receiver. + mmio_write(AUX_MU_CNTL_REG, 3); + + // clear rx data + uart_flush(); +} + +void uart_write(char c) { + while (!(mmio_read(AUX_MU_LSR_REG) & (1 << 5))) delay(1); + mmio_write(AUX_MU_IO_REG, c); +} + +char uart_read() { + while (!(mmio_read(AUX_MU_LSR_REG) & 1)) delay(1); + return (mmio_read(AUX_MU_IO_REG) & 0xff); +} + +void uart_flush() { + while (mmio_read(AUX_MU_LSR_REG) & 1) mmio_read(AUX_MU_IO_REG); +} + +void uart_write_string(char* str) { + for (uint32_t i = 0; str[i] != '\0'; i++) { + uart_write((char)str[i]); + } +} + +void uart_puth(uint32_t d) { + uint32_t c; + + for (int i = 28; i >= 0; i -= 4) { + /* Highest 4 bits */ + c = (d >> i) & 0xF; + /* Translate to hex */ + c = (c > 9) ? (0x37 + c) : (0x30 + c); + uart_write(c); + } +} \ No newline at end of file diff --git a/lab1/linker.ld b/lab1/linker.ld new file mode 100644 index 000000000..f51a65fe3 --- /dev/null +++ b/lab1/linker.ld @@ -0,0 +1,48 @@ +/* entry point */ +ENTRY(_start) + +SECTIONS +{ + /* start at LOADER_ADDR */ + . = 0x80000; + + __start = .; + __text_start = .; + .text : + { + KEEP(*(.text.boot)) + *(.text) + } + . = ALIGN(4096); /* align to page size */ + __text_end = .; + + . = ALIGN(4096); /* align to page size */ + .rodata : + { + *(.rodata) + } + __rodata_end = .; + + __data_start = .; + .data : + { + *(.data) + } + . = ALIGN(4096); /* align to page size */ + __data_end = .; + + __bss_start = .; + .bss : + { + bss = .; + *(.bss) + } + . = ALIGN(4096); /* align to page size */ + __bss_end = .; + __bss_size = __bss_end - __bss_start; + + . = 0x200000; + _estack = .; + + __end = .; +} \ No newline at end of file diff --git a/lab1/main.c b/lab1/main.c new file mode 100644 index 000000000..86e14f4a4 --- /dev/null +++ b/lab1/main.c @@ -0,0 +1,10 @@ +// #include "shell.h" +#include "stdint.h" +// #include "uart.h" + +void kernel_main(uint32_t r0, uint32_t r1, uint32_t atags) { + // initialize UART for Raspi2 + uart_init(); + + shell(); +} \ No newline at end of file diff --git a/lab1/main.o b/lab1/main.o new file mode 100644 index 0000000000000000000000000000000000000000..6395c8c5ad6b616ad62f620aa19cb813d23a4327 GIT binary patch literal 1656 zcmbVM-D(q25T4DpwrW~ht00Z&UIbClgDD8XtCgTt5HAElK}@&F)`ad4>>e@Ni~0x( z-s-hJfxQ#oz!%VW@BxB;lRaZkHd`+`%h{RvcD|W&W)8c5=fT~Ya|*G zL){=+;UI|f<`K<}E;^0+CGy~(XAp9MU$>W6KGr@tonJqf+5MmJ-skA|pQ;$Q@?=CV zo+@#XsY+a$pMe)A$Si((f>(8v>n8ndcl@g3RC(00Uqt008o%9jdI+pa@ zCN+=1DGr8->QS>#%@OT}SrSHF#^_~`>FzKY>cYyyq~FbTHcVb{UfF2_M_;lEN$oY@ zcDE*%1##y}xZHzv;P&w4JoCV7R(?|X>sSZd&^jyhK&&i`0;R)|Ce;sgKx#YBNo6TJ z9NtoGQoS^e!vrBoszZgldOg=cZx?aQ4hP+xEQmw9;<0QGENp#day~E?IbY$;&a8nC zd^>#!F#3sU#+LC Date: Thu, 7 Mar 2024 11:07:46 +0800 Subject: [PATCH 04/10] modify README.md --- README.md | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 000000000..c56b9b76e --- /dev/null +++ b/README.md @@ -0,0 +1,22 @@ +# OSC2023 + +| Github Account | Student ID | Name | +|----------------|------------|---------------| +| Haoze0102 | A122542 | Hao-Ze Wang | + +## Requirements + +* a cross-compiler for aarch64 +* (optional) qemu-system-arm + +## Build + +``` +make kernel.img +``` + +## Test With QEMU + +``` +qemu-system-aarch64 -M raspi3b -kernel kernel.img -initrd initramfs.cpio -serial null -serial stdio -dtb bcm2710-rpi-3-b-plus.dtb +``` \ No newline at end of file From b3d5b83abcfa2776d797044357e78bda0f488f8f Mon Sep 17 00:00:00 2001 From: root Date: Thu, 7 Mar 2024 15:32:53 +0800 Subject: [PATCH 05/10] add comment to function get_board_revision --- lab1/Makefile | 2 +- lab1/build/app/boot.o | Bin 0 -> 2400 bytes lab1/build/app/main.o | Bin 0 -> 3192 bytes lab1/build/kernel8.objdump | 669 +++++++++++++++++++++++++++++++++++++ lab1/build/lib/mbox.o | Bin 0 -> 4872 bytes lab1/build/lib/mmio.o | Bin 0 -> 3096 bytes lab1/build/lib/shell.o | Bin 0 -> 11328 bytes lab1/build/lib/uart.o | Bin 0 -> 6160 bytes lab1/kernel8.elf | Bin 0 -> 80384 bytes lab1/kernel8.img | Bin 0 -> 5464 bytes lab1/lib/mbox.c | 22 +- 11 files changed, 685 insertions(+), 8 deletions(-) create mode 100644 lab1/build/app/boot.o create mode 100644 lab1/build/app/main.o create mode 100644 lab1/build/kernel8.objdump create mode 100644 lab1/build/lib/mbox.o create mode 100644 lab1/build/lib/mmio.o create mode 100644 lab1/build/lib/shell.o create mode 100644 lab1/build/lib/uart.o create mode 100755 lab1/kernel8.elf create mode 100755 lab1/kernel8.img diff --git a/lab1/Makefile b/lab1/Makefile index 9b832051b..3fe0d0de7 100644 --- a/lab1/Makefile +++ b/lab1/Makefile @@ -127,7 +127,7 @@ $(BUILD_DIRECTORIES): mkdir -p $@ run: - qemu-system-aarch64 -M raspi3b -kernel kernel8.img -display none -serial null -serial stdio + qemu-system-aarch64 -M raspi3 -kernel kernel8.img -display none -serial null -serial stdio debug: qemu-system-aarch64 -M raspi3b -kernel kernel8.img -display none -serial null -serial stdio -s -S diff --git a/lab1/build/app/boot.o b/lab1/build/app/boot.o new file mode 100644 index 0000000000000000000000000000000000000000..c9c01fc536a16fd505aa09b3a6b20a67478b34fd GIT binary patch literal 2400 zcmbtW&2G~`5FW>&v_L~jk*J73b{l?#kkf`BaX_kDiNXO;p{m3Q*CwV!q=|403S6iV zH!cNn;0T;}03>*k@&LR85)y|nCbFTmz%dg@0Y7y>y9t-HYh7we5$+YgrD z`t40?Wy7jFml`QO(=szpfc9m$=#e-RXR^eE;utKpV;mPq5w2Ih95zsoUyKh2|h-L*&O_I4i42mRGZ*=L9gfaVn2%6ZoLTMaTs;NwzuQA zIWd%33td!?{EFgYV!Ch(7tyWikL%~Z5pKdY<@zqn~ouvFzf|881KO}^!r@+1G zdFBLtn4j;pC2`85oVpeX6%5uOD!F&v#-!KpjUyKVmBm`!P68 zKlZ`F;{hiM+rC4nL(fk7%`kYn?X_E-a0F;|9(FM}ne>Ao3ZIQk`;p(-4l$=-U`e@v z|5O!>$1Mcj2Ttd*p=si(VxvQt{=!|Aq}Y1=Ih>jHR4;{quc6N+RkR6F}cj zy0fPTN0!@Pdtw2d%1#`z9tIUqXA`2sNtw{=^bX(|0wHo9jZ@j)a&0xOwWlB z{Gb8F5o$Q<+*>%4RsXxJ|3yYpeX6b3zmJ%nlR}CTJWh@xI`;|A=@`*12`(zJWb(UY zxQ#|u|62s2a6I)-?_TeJ7cnZuJTwzom-WvwAT{@@>a4$deM$HrHGO00d#cx`Z=-(q esZ?2l{Cy>igzE|q@PC}__&vG)H%ydTkN*q$u6;TH literal 0 HcmV?d00001 diff --git a/lab1/build/app/main.o b/lab1/build/app/main.o new file mode 100644 index 0000000000000000000000000000000000000000..5c9515be864685d4710cefa2a58e76c30dbbfae3 GIT binary patch literal 3192 zcmbVO&2Jl35TEsWlNh&d6BpWGAPWkRB6ed(X`!VBw-GIs5L8IHaEaFT#$I*38||*C zOA&B{V1WRsG!2+E_y%@0MgfM?yK+;AO*jNq*tz=c7dtv!`+Whn|ER(CpNC-^&2Q0X!PI}+ zx%%CWTl&V&pCV8caWf+QJ|SnmmNIgIWX+gjh;7=3?;@l}bu`vUEL?jMZ^djmgHAg-a61cLcziUKGV4KGO0byj<@QZ4J1T4h$7n?86LOW4{| z^LpiE`HAw0^2754H;=q?c3!LENes|uQp<&E;RxOk0qL3oMmG9F^^^#kLQj}hEqItk zD3_na>HsAv&YXI7;uD?Nd1USF8 zcG6s0Zw-QEke<|P420Hrb)|0CSM8OfDK5HkP<&&HUVZ_J!~3+_z6CH5qen#~nti5X zepI}!Kl9tK_=x_WsN+TW``~S894^7_#Pv4xZF&%}y@`$<5x(iuPr#}ZDA1rpz z;SLtZxDFFQJTG_}n#Yb+!)A1>v)q!o0Hzh-X&jsAGgvS4|niv5bE$@jE4FT&gfH1$w1N zZ!cm;GyWxZMs8ypDl|F6}k<`MLh*q-03-ZJ;gh{ukx_O&LJE(lnkl99kk`u|5(=NIidQrchvd=#3(19 z6GcIXd0m->O^Vbp2i~mK&^WNYz9LJpY7R&5Iyr>SOG^)PzkCHH1PI}=zW&GnK zBo+An48Mm$UjJ_9^pAceIiCBPSDSJ-W&N+@f#(p*i>Kd+ysQ32heCQJWutHP{`6e) P;(w6mzcGqT1vUOZ%kA&l literal 0 HcmV?d00001 diff --git a/lab1/build/kernel8.objdump b/lab1/build/kernel8.objdump new file mode 100644 index 000000000..5ba56ca61 --- /dev/null +++ b/lab1/build/kernel8.objdump @@ -0,0 +1,669 @@ + +kernel8.elf: file format elf64-littleaarch64 + + +Disassembly of section .text: + +0000000000080000 <__start>: + 80000: d53800a1 mrs x1, mpidr_el1 + 80004: 92400421 and x1, x1, #0x3 + 80008: b4000061 cbz x1, 80014 <__start+0x14> + 8000c: d503205f wfe + 80010: 17ffffff b 8000c <__start+0xc> + 80014: 58000161 ldr x1, 80040 <__start+0x40> + 80018: 9100003f mov sp, x1 + 8001c: 58000161 ldr x1, 80048 <__start+0x48> + 80020: 180000e2 ldr w2, 8003c <__start+0x3c> + 80024: 34000082 cbz w2, 80034 <__start+0x34> + 80028: f800843f str xzr, [x1], #8 + 8002c: 51000442 sub w2, w2, #0x1 + 80030: 35ffffa2 cbnz w2, 80024 <__start+0x24> + 80034: 94000253 bl 80980 + 80038: 17fffff5 b 8000c <__start+0xc> + 8003c: 00001000 .word 0x00001000 + 80040: 00080000 .word 0x00080000 + 80044: 00000000 .word 0x00000000 + 80048: 00082000 .word 0x00082000 + 8004c: 00000000 .word 0x00000000 + +0000000000080050 : + 80050: d10043ff sub sp, sp, #0x10 + 80054: b9000fe0 str w0, [sp, #12] + 80058: b9000be1 str w1, [sp, #8] + 8005c: b9400fe0 ldr w0, [sp, #12] + 80060: aa0003e1 mov x1, x0 + 80064: b9400be0 ldr w0, [sp, #8] + 80068: b9000020 str w0, [x1] + 8006c: d503201f nop + 80070: 910043ff add sp, sp, #0x10 + 80074: d65f03c0 ret + +0000000000080078 : + 80078: d10043ff sub sp, sp, #0x10 + 8007c: b9000fe0 str w0, [sp, #12] + 80080: b9400fe0 ldr w0, [sp, #12] + 80084: b9400000 ldr w0, [x0] + 80088: 910043ff add sp, sp, #0x10 + 8008c: d65f03c0 ret + +0000000000080090 : + 80090: a9bd7bfd stp x29, x30, [sp, #-48]! + 80094: 910003fd mov x29, sp + 80098: f9000fe0 str x0, [sp, #24] + 8009c: 39005fe1 strb w1, [sp, #23] + 800a0: 14000002 b 800a8 + 800a4: d503201f nop + 800a8: 52971300 mov w0, #0xb898 // #47256 + 800ac: 72a7e000 movk w0, #0x3f00, lsl #16 + 800b0: 97fffff2 bl 80078 + 800b4: 7100001f cmp w0, #0x0 + 800b8: 54ffff6b b.lt 800a4 // b.tstop + 800bc: f9400fe0 ldr x0, [sp, #24] + 800c0: 121c6c01 and w1, w0, #0xfffffff0 + 800c4: 39405fe0 ldrb w0, [sp, #23] + 800c8: 12000c00 and w0, w0, #0xf + 800cc: 2a000020 orr w0, w1, w0 + 800d0: b9002fe0 str w0, [sp, #44] + 800d4: b9402fe1 ldr w1, [sp, #44] + 800d8: 52971400 mov w0, #0xb8a0 // #47264 + 800dc: 72a7e000 movk w0, #0x3f00, lsl #16 + 800e0: 97ffffdc bl 80050 + 800e4: 14000002 b 800ec + 800e8: d503201f nop + 800ec: 52971300 mov w0, #0xb898 // #47256 + 800f0: 72a7e000 movk w0, #0x3f00, lsl #16 + 800f4: 97ffffe1 bl 80078 + 800f8: 12020000 and w0, w0, #0x40000000 + 800fc: 7100001f cmp w0, #0x0 + 80100: 54ffff41 b.ne 800e8 // b.any + 80104: 52971000 mov w0, #0xb880 // #47232 + 80108: 72a7e000 movk w0, #0x3f00, lsl #16 + 8010c: 97ffffdb bl 80078 + 80110: 2a0003e1 mov w1, w0 + 80114: b9402fe0 ldr w0, [sp, #44] + 80118: 6b01001f cmp w0, w1 + 8011c: 54fffe81 b.ne 800ec // b.any + 80120: f9400fe0 ldr x0, [sp, #24] + 80124: b9400401 ldr w1, [x0, #4] + 80128: 52b00000 mov w0, #0x80000000 // #-2147483648 + 8012c: 6b00003f cmp w1, w0 + 80130: 1a9f17e0 cset w0, eq // eq = none + 80134: 12001c00 and w0, w0, #0xff + 80138: a8c37bfd ldp x29, x30, [sp], #48 + 8013c: d65f03c0 ret + +0000000000080140 : + 80140: a9bb7bfd stp x29, x30, [sp, #-80]! + 80144: 910003fd mov x29, sp + 80148: f9000fe0 str x0, [sp, #24] + 8014c: a9027fff stp xzr, xzr, [sp, #32] + 80150: a9037fff stp xzr, xzr, [sp, #48] + 80154: f90023ff str xzr, [sp, #64] + 80158: 52800500 mov w0, #0x28 // #40 + 8015c: b90023e0 str w0, [sp, #32] + 80160: 52800040 mov w0, #0x2 // #2 + 80164: 72a00020 movk w0, #0x1, lsl #16 + 80168: b9002be0 str w0, [sp, #40] + 8016c: 52800200 mov w0, #0x10 // #16 + 80170: b9002fe0 str w0, [sp, #44] + 80174: b9004fff str wzr, [sp, #76] + 80178: 14000008 b 80198 + 8017c: b9404fe0 ldr w0, [sp, #76] + 80180: d37ef400 lsl x0, x0, #2 + 80184: 9100d3e1 add x1, sp, #0x34 + 80188: b820683f str wzr, [x1, x0] + 8018c: b9404fe0 ldr w0, [sp, #76] + 80190: 11000400 add w0, w0, #0x1 + 80194: b9004fe0 str w0, [sp, #76] + 80198: b9404fe0 ldr w0, [sp, #76] + 8019c: 71000c1f cmp w0, #0x3 + 801a0: 54fffee9 b.ls 8017c // b.plast + 801a4: 910083e0 add x0, sp, #0x20 + 801a8: 52800101 mov w1, #0x8 // #8 + 801ac: 97ffffb9 bl 80090 + 801b0: b9402be0 ldr w0, [sp, #40] + 801b4: 940001bb bl 808a0 + 801b8: b94037e1 ldr w1, [sp, #52] + 801bc: f9400fe0 ldr x0, [sp, #24] + 801c0: b9000001 str w1, [x0] + 801c4: d503201f nop + 801c8: a8c57bfd ldp x29, x30, [sp], #80 + 801cc: d65f03c0 ret + +00000000000801d0 : + 801d0: d10083ff sub sp, sp, #0x20 + 801d4: f90007e0 str x0, [sp, #8] + 801d8: f90003e1 str x1, [sp] + 801dc: b9001fff str wzr, [sp, #28] + 801e0: 14000004 b 801f0 + 801e4: b9401fe0 ldr w0, [sp, #28] + 801e8: 11000400 add w0, w0, #0x1 + 801ec: b9001fe0 str w0, [sp, #28] + 801f0: b9401fe0 ldr w0, [sp, #28] + 801f4: f94007e1 ldr x1, [sp, #8] + 801f8: 8b000020 add x0, x1, x0 + 801fc: 39400001 ldrb w1, [x0] + 80200: b9401fe0 ldr w0, [sp, #28] + 80204: f94003e2 ldr x2, [sp] + 80208: 8b000040 add x0, x2, x0 + 8020c: 39400000 ldrb w0, [x0] + 80210: 6b00003f cmp w1, w0 + 80214: 540001a1 b.ne 80248 // b.any + 80218: b9401fe0 ldr w0, [sp, #28] + 8021c: f94007e1 ldr x1, [sp, #8] + 80220: 8b000020 add x0, x1, x0 + 80224: 39400000 ldrb w0, [x0] + 80228: 7100001f cmp w0, #0x0 + 8022c: 540000e0 b.eq 80248 // b.none + 80230: b9401fe0 ldr w0, [sp, #28] + 80234: f94003e1 ldr x1, [sp] + 80238: 8b000020 add x0, x1, x0 + 8023c: 39400000 ldrb w0, [x0] + 80240: 7100001f cmp w0, #0x0 + 80244: 54fffd01 b.ne 801e4 // b.any + 80248: b9401fe0 ldr w0, [sp, #28] + 8024c: f94007e1 ldr x1, [sp, #8] + 80250: 8b000020 add x0, x1, x0 + 80254: 39400000 ldrb w0, [x0] + 80258: 2a0003e2 mov w2, w0 + 8025c: b9401fe0 ldr w0, [sp, #28] + 80260: f94003e1 ldr x1, [sp] + 80264: 8b000020 add x0, x1, x0 + 80268: 39400000 ldrb w0, [x0] + 8026c: 4b000040 sub w0, w2, w0 + 80270: 910083ff add sp, sp, #0x20 + 80274: d65f03c0 ret + +0000000000080278 : + 80278: d10083ff sub sp, sp, #0x20 + 8027c: f90007e0 str x0, [sp, #8] + 80280: b9001fff str wzr, [sp, #28] + 80284: b9401fe0 ldr w0, [sp, #28] + 80288: f94007e1 ldr x1, [sp, #8] + 8028c: 8b000020 add x0, x1, x0 + 80290: 39400000 ldrb w0, [x0] + 80294: 7100001f cmp w0, #0x0 + 80298: 54000061 b.ne 802a4 // b.any + 8029c: b9401fe0 ldr w0, [sp, #28] + 802a0: 14000005 b 802b4 + 802a4: b9401fe0 ldr w0, [sp, #28] + 802a8: 11000400 add w0, w0, #0x1 + 802ac: b9001fe0 str w0, [sp, #28] + 802b0: 17fffff5 b 80284 + 802b4: 910083ff add sp, sp, #0x20 + 802b8: d65f03c0 ret + +00000000000802bc : + 802bc: a9bf7bfd stp x29, x30, [sp, #-16]! + 802c0: 910003fd mov x29, sp + 802c4: b0000000 adrp x0, 81000 <__text_end> + 802c8: 9101e000 add x0, x0, #0x78 + 802cc: 94000175 bl 808a0 + 802d0: d503201f nop + 802d4: a8c17bfd ldp x29, x30, [sp], #16 + 802d8: d65f03c0 ret + +00000000000802dc : + 802dc: a9be7bfd stp x29, x30, [sp, #-32]! + 802e0: 910003fd mov x29, sp + 802e4: b0000000 adrp x0, 81000 <__text_end> + 802e8: 91070000 add x0, x0, #0x1c0 + 802ec: 9400016d bl 808a0 + 802f0: b9001fff str wzr, [sp, #28] + 802f4: 1400002b b 803a0 + 802f8: 39406fe0 ldrb w0, [sp, #27] + 802fc: 94000134 bl 807cc + 80300: 39406fe0 ldrb w0, [sp, #27] + 80304: 7101fc1f cmp w0, #0x7f + 80308: 540001e0 b.eq 80344 // b.none + 8030c: 7101fc1f cmp w0, #0x7f + 80310: 5400036c b.gt 8037c + 80314: 7100281f cmp w0, #0xa + 80318: 54000060 b.eq 80324 // b.none + 8031c: 7100341f cmp w0, #0xd + 80320: 540002e1 b.ne 8037c // b.any + 80324: b9401fe0 ldr w0, [sp, #28] + 80328: 11000401 add w1, w0, #0x1 + 8032c: b9001fe1 str w1, [sp, #28] + 80330: b0000001 adrp x1, 81000 <__text_end> + 80334: f9426c21 ldr x1, [x1, #1240] + 80338: 2a0003e0 mov w0, w0 + 8033c: 3820683f strb wzr, [x1, x0] + 80340: 1400001d b 803b4 + 80344: b9401fe0 ldr w0, [sp, #28] + 80348: 7100001f cmp w0, #0x0 + 8034c: 540002a0 b.eq 803a0 // b.none + 80350: b9401fe0 ldr w0, [sp, #28] + 80354: 51000400 sub w0, w0, #0x1 + 80358: b9001fe0 str w0, [sp, #28] + 8035c: b0000000 adrp x0, 81000 <__text_end> + 80360: f9426c01 ldr x1, [x0, #1240] + 80364: b9401fe0 ldr w0, [sp, #28] + 80368: 3820683f strb wzr, [x1, x0] + 8036c: b0000000 adrp x0, 81000 <__text_end> + 80370: 91072000 add x0, x0, #0x1c8 + 80374: 9400014b bl 808a0 + 80378: 1400000a b 803a0 + 8037c: b9401fe0 ldr w0, [sp, #28] + 80380: 11000401 add w1, w0, #0x1 + 80384: b9001fe1 str w1, [sp, #28] + 80388: b0000001 adrp x1, 81000 <__text_end> + 8038c: f9426c21 ldr x1, [x1, #1240] + 80390: 2a0003e0 mov w0, w0 + 80394: 39406fe2 ldrb w2, [sp, #27] + 80398: 38206822 strb w2, [x1, x0] + 8039c: d503201f nop + 803a0: 9400011f bl 8081c + 803a4: 39006fe0 strb w0, [sp, #27] + 803a8: 39406fe0 ldrb w0, [sp, #27] + 803ac: 7100001f cmp w0, #0x0 + 803b0: 54fffa41 b.ne 802f8 // b.any + 803b4: a8c27bfd ldp x29, x30, [sp], #32 + 803b8: d65f03c0 ret + +00000000000803bc : + 803bc: a9be7bfd stp x29, x30, [sp, #-32]! + 803c0: 910003fd mov x29, sp + 803c4: b0000000 adrp x0, 81000 <__text_end> + 803c8: f9426c00 ldr x0, [x0, #1240] + 803cc: 97ffffab bl 80278 + 803d0: 7100001f cmp w0, #0x0 + 803d4: 540004a0 b.eq 80468 // b.none + 803d8: b9001fff str wzr, [sp, #28] + 803dc: 1400001e b 80454 + 803e0: b0000000 adrp x0, 81000 <__text_end> + 803e4: 9113e002 add x2, x0, #0x4f8 + 803e8: b9401fe1 ldr w1, [sp, #28] + 803ec: aa0103e0 mov x0, x1 + 803f0: d37ff800 lsl x0, x0, #1 + 803f4: 8b010000 add x0, x0, x1 + 803f8: d37df000 lsl x0, x0, #3 + 803fc: 8b000040 add x0, x2, x0 + 80400: f9400000 ldr x0, [x0] + 80404: aa0003e1 mov x1, x0 + 80408: b0000000 adrp x0, 81000 <__text_end> + 8040c: f9426c00 ldr x0, [x0, #1240] + 80410: 97ffff70 bl 801d0 + 80414: 7100001f cmp w0, #0x0 + 80418: 54000181 b.ne 80448 // b.any + 8041c: b0000000 adrp x0, 81000 <__text_end> + 80420: 9113e002 add x2, x0, #0x4f8 + 80424: b9401fe1 ldr w1, [sp, #28] + 80428: aa0103e0 mov x0, x1 + 8042c: d37ff800 lsl x0, x0, #1 + 80430: 8b010000 add x0, x0, x1 + 80434: d37df000 lsl x0, x0, #3 + 80438: 8b000040 add x0, x2, x0 + 8043c: f9400400 ldr x0, [x0, #8] + 80440: d63f0000 blr x0 + 80444: 1400000a b 8046c + 80448: b9401fe0 ldr w0, [sp, #28] + 8044c: 11000400 add w0, w0, #0x1 + 80450: b9001fe0 str w0, [sp, #28] + 80454: b9401fe0 ldr w0, [sp, #28] + 80458: 71000c1f cmp w0, #0x3 + 8045c: 54fffc29 b.ls 803e0 // b.plast + 80460: 9400005e bl 805d8 + 80464: 14000002 b 8046c + 80468: d503201f nop + 8046c: a8c27bfd ldp x29, x30, [sp], #32 + 80470: d65f03c0 ret + +0000000000080474 : + 80474: a9be7bfd stp x29, x30, [sp, #-32]! + 80478: 910003fd mov x29, sp + 8047c: b9001fff str wzr, [sp, #28] + 80480: 14000035 b 80554 + 80484: b0000000 adrp x0, 81000 <__text_end> + 80488: 9113e002 add x2, x0, #0x4f8 + 8048c: b9401fe1 ldr w1, [sp, #28] + 80490: aa0103e0 mov x0, x1 + 80494: d37ff800 lsl x0, x0, #1 + 80498: 8b010000 add x0, x0, x1 + 8049c: d37df000 lsl x0, x0, #3 + 804a0: 8b000040 add x0, x2, x0 + 804a4: f9400000 ldr x0, [x0] + 804a8: 940000fe bl 808a0 + 804ac: b9001bff str wzr, [sp, #24] + 804b0: 14000006 b 804c8 + 804b4: 52800400 mov w0, #0x20 // #32 + 804b8: 940000c5 bl 807cc + 804bc: b9401be0 ldr w0, [sp, #24] + 804c0: 11000400 add w0, w0, #0x1 + 804c4: b9001be0 str w0, [sp, #24] + 804c8: b0000000 adrp x0, 81000 <__text_end> + 804cc: 9113e002 add x2, x0, #0x4f8 + 804d0: b9401fe1 ldr w1, [sp, #28] + 804d4: aa0103e0 mov x0, x1 + 804d8: d37ff800 lsl x0, x0, #1 + 804dc: 8b010000 add x0, x0, x1 + 804e0: d37df000 lsl x0, x0, #3 + 804e4: 8b000040 add x0, x2, x0 + 804e8: f9400000 ldr x0, [x0] + 804ec: 97ffff63 bl 80278 + 804f0: 2a0003e1 mov w1, w0 + 804f4: 52800140 mov w0, #0xa // #10 + 804f8: 4b010000 sub w0, w0, w1 + 804fc: b9401be1 ldr w1, [sp, #24] + 80500: 6b00003f cmp w1, w0 + 80504: 54fffd83 b.cc 804b4 // b.lo, b.ul, b.last + 80508: b0000000 adrp x0, 81000 <__text_end> + 8050c: 91074000 add x0, x0, #0x1d0 + 80510: 940000e4 bl 808a0 + 80514: b0000000 adrp x0, 81000 <__text_end> + 80518: 9113e002 add x2, x0, #0x4f8 + 8051c: b9401fe1 ldr w1, [sp, #28] + 80520: aa0103e0 mov x0, x1 + 80524: d37ff800 lsl x0, x0, #1 + 80528: 8b010000 add x0, x0, x1 + 8052c: d37df000 lsl x0, x0, #3 + 80530: 8b000040 add x0, x2, x0 + 80534: f9400800 ldr x0, [x0, #16] + 80538: 940000da bl 808a0 + 8053c: b0000000 adrp x0, 81000 <__text_end> + 80540: 91076000 add x0, x0, #0x1d8 + 80544: 940000d7 bl 808a0 + 80548: b9401fe0 ldr w0, [sp, #28] + 8054c: 11000400 add w0, w0, #0x1 + 80550: b9001fe0 str w0, [sp, #28] + 80554: b9401fe0 ldr w0, [sp, #28] + 80558: 71000c1f cmp w0, #0x3 + 8055c: 54fff949 b.ls 80484 // b.plast + 80560: d503201f nop + 80564: d503201f nop + 80568: a8c27bfd ldp x29, x30, [sp], #32 + 8056c: d65f03c0 ret + +0000000000080570 : + 80570: a9bf7bfd stp x29, x30, [sp, #-16]! + 80574: 910003fd mov x29, sp + 80578: b0000000 adrp x0, 81000 <__text_end> + 8057c: 91078000 add x0, x0, #0x1e0 + 80580: 940000c8 bl 808a0 + 80584: d503201f nop + 80588: a8c17bfd ldp x29, x30, [sp], #16 + 8058c: d65f03c0 ret + +0000000000080590 : + 80590: a9be7bfd stp x29, x30, [sp, #-32]! + 80594: 910003fd mov x29, sp + 80598: 52800280 mov w0, #0x14 // #20 + 8059c: b9001fe0 str w0, [sp, #28] + 805a0: f9400be0 ldr x0, [sp, #16] + 805a4: 97fffee7 bl 80140 + 805a8: b0000000 adrp x0, 81000 <__text_end> + 805ac: 9107c000 add x0, x0, #0x1f0 + 805b0: 940000bc bl 808a0 + 805b4: f9400be0 ldr x0, [sp, #16] + 805b8: b9400000 ldr w0, [x0] + 805bc: 940000d0 bl 808fc + 805c0: b0000000 adrp x0, 81000 <__text_end> + 805c4: 91076000 add x0, x0, #0x1d8 + 805c8: 940000b6 bl 808a0 + 805cc: d503201f nop + 805d0: a8c27bfd ldp x29, x30, [sp], #32 + 805d4: d65f03c0 ret + +00000000000805d8 : + 805d8: a9bf7bfd stp x29, x30, [sp, #-16]! + 805dc: 910003fd mov x29, sp + 805e0: b0000000 adrp x0, 81000 <__text_end> + 805e4: 91084000 add x0, x0, #0x210 + 805e8: 940000ae bl 808a0 + 805ec: b0000000 adrp x0, 81000 <__text_end> + 805f0: f9426c00 ldr x0, [x0, #1240] + 805f4: 940000ab bl 808a0 + 805f8: b0000000 adrp x0, 81000 <__text_end> + 805fc: 91076000 add x0, x0, #0x1d8 + 80600: 940000a8 bl 808a0 + 80604: d503201f nop + 80608: a8c17bfd ldp x29, x30, [sp], #16 + 8060c: d65f03c0 ret + +0000000000080610 : + 80610: a9bf7bfd stp x29, x30, [sp, #-16]! + 80614: 910003fd mov x29, sp + 80618: 97ffff29 bl 802bc + 8061c: 97ffff30 bl 802dc + 80620: b0000000 adrp x0, 81000 <__text_end> + 80624: 91070000 add x0, x0, #0x1c0 + 80628: 9400009e bl 808a0 + 8062c: b0000000 adrp x0, 81000 <__text_end> + 80630: f9426c00 ldr x0, [x0, #1240] + 80634: 9400009b bl 808a0 + 80638: b0000000 adrp x0, 81000 <__text_end> + 8063c: 91076000 add x0, x0, #0x1d8 + 80640: 94000098 bl 808a0 + 80644: 97ffff5e bl 803bc + 80648: 17fffff5 b 8061c + +000000000008064c : + 8064c: d10083ff sub sp, sp, #0x20 + 80650: b9000fe0 str w0, [sp, #12] + 80654: b9001fff str wzr, [sp, #28] + 80658: 14000005 b 8066c + 8065c: d503201f nop + 80660: b9401fe0 ldr w0, [sp, #28] + 80664: 11000400 add w0, w0, #0x1 + 80668: b9001fe0 str w0, [sp, #28] + 8066c: b9401fe1 ldr w1, [sp, #28] + 80670: b9400fe0 ldr w0, [sp, #12] + 80674: 6b00003f cmp w1, w0 + 80678: 54ffff23 b.cc 8065c // b.lo, b.ul, b.last + 8067c: d503201f nop + 80680: d503201f nop + 80684: 910083ff add sp, sp, #0x20 + 80688: d65f03c0 ret + +000000000008068c : + 8068c: a9be7bfd stp x29, x30, [sp, #-32]! + 80690: 910003fd mov x29, sp + 80694: 52800080 mov w0, #0x4 // #4 + 80698: 72a7e400 movk w0, #0x3f20, lsl #16 + 8069c: 97fffe77 bl 80078 + 806a0: b9001fe0 str w0, [sp, #28] + 806a4: b9401fe0 ldr w0, [sp, #28] + 806a8: 12117000 and w0, w0, #0xffff8fff + 806ac: b9001fe0 str w0, [sp, #28] + 806b0: b9401fe0 ldr w0, [sp, #28] + 806b4: 32130000 orr w0, w0, #0x2000 + 806b8: b9001fe0 str w0, [sp, #28] + 806bc: b9401fe0 ldr w0, [sp, #28] + 806c0: 120e7000 and w0, w0, #0xfffc7fff + 806c4: b9001fe0 str w0, [sp, #28] + 806c8: b9401fe0 ldr w0, [sp, #28] + 806cc: 32100000 orr w0, w0, #0x10000 + 806d0: b9001fe0 str w0, [sp, #28] + 806d4: b9401fe1 ldr w1, [sp, #28] + 806d8: 52800080 mov w0, #0x4 // #4 + 806dc: 72a7e400 movk w0, #0x3f20, lsl #16 + 806e0: 97fffe5c bl 80050 + 806e4: 52800001 mov w1, #0x0 // #0 + 806e8: 52801280 mov w0, #0x94 // #148 + 806ec: 72a7e400 movk w0, #0x3f20, lsl #16 + 806f0: 97fffe58 bl 80050 + 806f4: 528012c0 mov w0, #0x96 // #150 + 806f8: 97ffffd5 bl 8064c + 806fc: 52980001 mov w1, #0xc000 // #49152 + 80700: 52801300 mov w0, #0x98 // #152 + 80704: 72a7e400 movk w0, #0x3f20, lsl #16 + 80708: 97fffe52 bl 80050 + 8070c: 528012c0 mov w0, #0x96 // #150 + 80710: 97ffffcf bl 8064c + 80714: 52800001 mov w1, #0x0 // #0 + 80718: 52801300 mov w0, #0x98 // #152 + 8071c: 72a7e400 movk w0, #0x3f20, lsl #16 + 80720: 97fffe4c bl 80050 + 80724: 528a0080 mov w0, #0x5004 // #20484 + 80728: 72a7e420 movk w0, #0x3f21, lsl #16 + 8072c: 97fffe53 bl 80078 + 80730: b9001fe0 str w0, [sp, #28] + 80734: b9401fe0 ldr w0, [sp, #28] + 80738: 32000000 orr w0, w0, #0x1 + 8073c: 2a0003e1 mov w1, w0 + 80740: 528a0080 mov w0, #0x5004 // #20484 + 80744: 72a7e420 movk w0, #0x3f21, lsl #16 + 80748: 97fffe42 bl 80050 + 8074c: 52800001 mov w1, #0x0 // #0 + 80750: 528a0c00 mov w0, #0x5060 // #20576 + 80754: 72a7e420 movk w0, #0x3f21, lsl #16 + 80758: 97fffe3e bl 80050 + 8075c: 52800001 mov w1, #0x0 // #0 + 80760: 528a0880 mov w0, #0x5044 // #20548 + 80764: 72a7e420 movk w0, #0x3f21, lsl #16 + 80768: 97fffe3a bl 80050 + 8076c: 52800061 mov w1, #0x3 // #3 + 80770: 528a0980 mov w0, #0x504c // #20556 + 80774: 72a7e420 movk w0, #0x3f21, lsl #16 + 80778: 97fffe36 bl 80050 + 8077c: 52800001 mov w1, #0x0 // #0 + 80780: 528a0a00 mov w0, #0x5050 // #20560 + 80784: 72a7e420 movk w0, #0x3f21, lsl #16 + 80788: 97fffe32 bl 80050 + 8078c: 528021c1 mov w1, #0x10e // #270 + 80790: 528a0d00 mov w0, #0x5068 // #20584 + 80794: 72a7e420 movk w0, #0x3f21, lsl #16 + 80798: 97fffe2e bl 80050 + 8079c: 528000c1 mov w1, #0x6 // #6 + 807a0: 528a0900 mov w0, #0x5048 // #20552 + 807a4: 72a7e420 movk w0, #0x3f21, lsl #16 + 807a8: 97fffe2a bl 80050 + 807ac: 52800061 mov w1, #0x3 // #3 + 807b0: 528a0c00 mov w0, #0x5060 // #20576 + 807b4: 72a7e420 movk w0, #0x3f21, lsl #16 + 807b8: 97fffe26 bl 80050 + 807bc: 94000029 bl 80860 + 807c0: d503201f nop + 807c4: a8c27bfd ldp x29, x30, [sp], #32 + 807c8: d65f03c0 ret + +00000000000807cc : + 807cc: a9be7bfd stp x29, x30, [sp, #-32]! + 807d0: 910003fd mov x29, sp + 807d4: 39007fe0 strb w0, [sp, #31] + 807d8: 14000003 b 807e4 + 807dc: 52800020 mov w0, #0x1 // #1 + 807e0: 97ffff9b bl 8064c + 807e4: 528a0a80 mov w0, #0x5054 // #20564 + 807e8: 72a7e420 movk w0, #0x3f21, lsl #16 + 807ec: 97fffe23 bl 80078 + 807f0: 121b0000 and w0, w0, #0x20 + 807f4: 7100001f cmp w0, #0x0 + 807f8: 54ffff20 b.eq 807dc // b.none + 807fc: 39407fe0 ldrb w0, [sp, #31] + 80800: 2a0003e1 mov w1, w0 + 80804: 528a0800 mov w0, #0x5040 // #20544 + 80808: 72a7e420 movk w0, #0x3f21, lsl #16 + 8080c: 97fffe11 bl 80050 + 80810: d503201f nop + 80814: a8c27bfd ldp x29, x30, [sp], #32 + 80818: d65f03c0 ret + +000000000008081c : + 8081c: a9bf7bfd stp x29, x30, [sp, #-16]! + 80820: 910003fd mov x29, sp + 80824: 14000003 b 80830 + 80828: 52800020 mov w0, #0x1 // #1 + 8082c: 97ffff88 bl 8064c + 80830: 528a0a80 mov w0, #0x5054 // #20564 + 80834: 72a7e420 movk w0, #0x3f21, lsl #16 + 80838: 97fffe10 bl 80078 + 8083c: 12000000 and w0, w0, #0x1 + 80840: 7100001f cmp w0, #0x0 + 80844: 54ffff20 b.eq 80828 // b.none + 80848: 528a0800 mov w0, #0x5040 // #20544 + 8084c: 72a7e420 movk w0, #0x3f21, lsl #16 + 80850: 97fffe0a bl 80078 + 80854: 12001c00 and w0, w0, #0xff + 80858: a8c17bfd ldp x29, x30, [sp], #16 + 8085c: d65f03c0 ret + +0000000000080860 : + 80860: a9bf7bfd stp x29, x30, [sp, #-16]! + 80864: 910003fd mov x29, sp + 80868: 14000004 b 80878 + 8086c: 528a0800 mov w0, #0x5040 // #20544 + 80870: 72a7e420 movk w0, #0x3f21, lsl #16 + 80874: 97fffe01 bl 80078 + 80878: 528a0a80 mov w0, #0x5054 // #20564 + 8087c: 72a7e420 movk w0, #0x3f21, lsl #16 + 80880: 97fffdfe bl 80078 + 80884: 12000000 and w0, w0, #0x1 + 80888: 7100001f cmp w0, #0x0 + 8088c: 54ffff01 b.ne 8086c // b.any + 80890: d503201f nop + 80894: d503201f nop + 80898: a8c17bfd ldp x29, x30, [sp], #16 + 8089c: d65f03c0 ret + +00000000000808a0 : + 808a0: a9bd7bfd stp x29, x30, [sp, #-48]! + 808a4: 910003fd mov x29, sp + 808a8: f9000fe0 str x0, [sp, #24] + 808ac: b9002fff str wzr, [sp, #44] + 808b0: 14000009 b 808d4 + 808b4: b9402fe0 ldr w0, [sp, #44] + 808b8: f9400fe1 ldr x1, [sp, #24] + 808bc: 8b000020 add x0, x1, x0 + 808c0: 39400000 ldrb w0, [x0] + 808c4: 97ffffc2 bl 807cc + 808c8: b9402fe0 ldr w0, [sp, #44] + 808cc: 11000400 add w0, w0, #0x1 + 808d0: b9002fe0 str w0, [sp, #44] + 808d4: b9402fe0 ldr w0, [sp, #44] + 808d8: f9400fe1 ldr x1, [sp, #24] + 808dc: 8b000020 add x0, x1, x0 + 808e0: 39400000 ldrb w0, [x0] + 808e4: 7100001f cmp w0, #0x0 + 808e8: 54fffe61 b.ne 808b4 // b.any + 808ec: d503201f nop + 808f0: d503201f nop + 808f4: a8c37bfd ldp x29, x30, [sp], #48 + 808f8: d65f03c0 ret + +00000000000808fc : + 808fc: a9bd7bfd stp x29, x30, [sp, #-48]! + 80900: 910003fd mov x29, sp + 80904: b9001fe0 str w0, [sp, #28] + 80908: 52800380 mov w0, #0x1c // #28 + 8090c: b9002fe0 str w0, [sp, #44] + 80910: 14000015 b 80964 + 80914: b9402fe0 ldr w0, [sp, #44] + 80918: b9401fe1 ldr w1, [sp, #28] + 8091c: 1ac02420 lsr w0, w1, w0 + 80920: 12000c00 and w0, w0, #0xf + 80924: b9002be0 str w0, [sp, #40] + 80928: b9402be0 ldr w0, [sp, #40] + 8092c: 7100241f cmp w0, #0x9 + 80930: 54000089 b.ls 80940 // b.plast + 80934: b9402be0 ldr w0, [sp, #40] + 80938: 1100dc00 add w0, w0, #0x37 + 8093c: 14000003 b 80948 + 80940: b9402be0 ldr w0, [sp, #40] + 80944: 1100c000 add w0, w0, #0x30 + 80948: b9002be0 str w0, [sp, #40] + 8094c: b9402be0 ldr w0, [sp, #40] + 80950: 12001c00 and w0, w0, #0xff + 80954: 97ffff9e bl 807cc + 80958: b9402fe0 ldr w0, [sp, #44] + 8095c: 51001000 sub w0, w0, #0x4 + 80960: b9002fe0 str w0, [sp, #44] + 80964: b9402fe0 ldr w0, [sp, #44] + 80968: 7100001f cmp w0, #0x0 + 8096c: 54fffd4a b.ge 80914 // b.tcont + 80970: d503201f nop + 80974: d503201f nop + 80978: a8c37bfd ldp x29, x30, [sp], #48 + 8097c: d65f03c0 ret + +0000000000080980 : + 80980: a9be7bfd stp x29, x30, [sp, #-32]! + 80984: 910003fd mov x29, sp + 80988: b9001fe0 str w0, [sp, #28] + 8098c: b9001be1 str w1, [sp, #24] + 80990: b90017e2 str w2, [sp, #20] + 80994: 97ffff3e bl 8068c + 80998: 97ffff1e bl 80610 + 8099c: d503201f nop + 809a0: a8c27bfd ldp x29, x30, [sp], #32 + 809a4: d65f03c0 ret diff --git a/lab1/build/lib/mbox.o b/lab1/build/lib/mbox.o new file mode 100644 index 0000000000000000000000000000000000000000..b633b026d685a61bd8bbceea1fc9cbd420504b05 GIT binary patch literal 4872 zcmbtYU5p#m6+ScLn|Nc#>$Q{YZWFNs*))XUv3J=53;A&pAlVcp>8eqw_%UO9)*fPy z!*~n{X~|af0p7Aw1VVzq8-%CuM3xE(ia??d?E`9yL|eR4AAlEBsS=8+WqZz@d%d%F zotO4RzW1K*{N8i_W^?huhab{44J2vs9;|W_1&F6s$3;FY!WPKF@`VqsE*r4W9fTW8 zC79L$wv3s^pCS9oEOg)UQT6f|z|&_|R({?cEZ)!>J2Kr;aT=14F#+!A=3#LuUtEMO ztNQ(X0O%R=a|r!FdR2GHARooWG0@KZ<_8fYhW_B%>_LDt-QhQW1Un$JeBtA_KQu~z zS-$YQUcM_A^{XovjjJm=;Rdkz+3rqQEW-S(32*w{y|4&6Vwm5`Nmz{Iyt*gR@4uh_ zeCcyoI9NBYb3O(`U6j*!ED2A4Lpi(v3z{}ROLOn;rCi|h(mlmRK7W8ks?YL;Pk26m zz+%Tx0V~YQp5)_5Q;e(z76$e7U&K#iZxEwDlA^I-e#w~_#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qEi|Vrag#k5lex5%;Jd1y-__V(I zU>?t3ppj+WZ`Rz9%4qsNQhb$e6k6*-Nb=KE9JEdGzG{_jRiDVY3!0JWp-+5i9m literal 0 HcmV?d00001 diff --git a/lab1/build/lib/shell.o b/lab1/build/lib/shell.o new file mode 100644 index 0000000000000000000000000000000000000000..6dd546f123f0bcb5b6c70f5f806389a32ae2b1c9 GIT binary patch literal 11328 zcmcIqZ)_CD6`#GmfwRvx7#nQ!Ctec*Cc$Te-0&xMxIjW|KnW$#QU&Qa-z~mN&UfbS z987=~nkq^~sz4jHs!9?Xr4fzNDyf>5s3@gXBk`dhn$kx3kX9y*)Oa#H^V|SPqfG16k*Xg0W!8P&WvC6ggEAi_*#@daN}2jy%3N7 z&=EUKJH*?C*f${v2Yd8q+_^q^gZ&4txLt7=w$R5Gi0{NXH}NjVi7{5{D@lDxEB;R> zCtH}~`oUlS__`}j2qBKcAJ)&dd+wjFANK>zK%V&BD(9(N@I~7CUg9 zw?H4*X9)Vd2r*2!&MV@|*DeU*921uhUx@2D#I^DY+QEDV97iD^H}wsp{rY!#Ean<( zuM_*0Uzw-Z_OSF9oeq#*Jy>l6bAjl zc+41X){nNmkx%>aJrl%-+|&50`J)})mr#q0pBu$`w3yA8y>cd7@(}Vy{QMZ{bA>=Z z;OBA$@5_Z^F5Q7zA&UM`p-|=;2z)Q?KbB4TS}jTkO4(m zP@qyZHc+OTU=89G{-IAd7Ssrl1VMh8AEJCAz4g&+hK}I*+O28##`t0jB6Gl zcIF?=7xw49RAFQ!nNKqvtN(BH06h5MAC!oCeAd}L9nx9_hr%B2BaF*Av8oS`n?T*%4$;74~^{=A$P_b08LpnfFwc>!%nD6AJxvu`7qR346mTZ zY^*~wBr0p5*%+2^Yl@jDYpR_A6+WV{I42(ht>vkWHwDH6+7^uA;VI^z6uN&FwnHaI zo0K@9L~1Wam2M9j_~860_sz39l>4D(<*tK%2cQ}X=0P6Dj7S%l=#b(;NFKUDaZWbD zL#JZ=cLv7Sv@IC_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1WRdIVs`!6O4*i@S0v4=JWJe%WpE!!V|->~-%fW&z^%)f<#QLN#pUkWPupSevty>0kn)As)l!auOh literal 0 HcmV?d00001 diff --git a/lab1/build/lib/uart.o b/lab1/build/lib/uart.o new file mode 100644 index 0000000000000000000000000000000000000000..f9c9d7a61c63beaec0060e94a350851d83cfb815 GIT binary patch literal 6160 zcmbtXU2Ggz6+Sbw*FRZ%ZSSTKV-t^46I{}rwT;`#t({B~pta*Btw{=%g50%t?Ok=f z>+TPANNFs!Ra@WzOA!>|L_AOtBpxb+ge(zg$~;z&Dl&UeoF?zz8n_sS<{KV@4MD6!y&(6AH=(4A=LzEpiU2npDI34UGgg00;F z*b)E-2VCbj^#OkiBG6Mu>^AE4E`RF;z_a)6?w%(<{V;E1+nN9E&gCC}cgKN^by%N+ zKYXW*)K@7_a;)~mLmd)hp}rc^@NS7yJ35DjeCzQB=QiocZNVFJkZ6V@rs3=Gr8(EE z2Vm^B10U0U)DCnsVr9E+4LePBv^Q)Sf1qLC9K`%i%_crAp7M2m>I046&gGxp(8sTS z1tuIEf0yDhW?gFopf5fE@SKa|U%%o{P#-|6aWCIbf5-! zIfnWk*3%775+~I|HO%bXUBgY>U^q4?ZE~x1NL_o3V=GE*QtXQ@%6^#@Yx5PC+b_#MfEJs>v8tsa^}uPDg;#7I>x;_93il+yF!rDdRXPEkh8E9!F-J9aeE9+qw{)My7TT8m)wF z036Wq>4fHq>UD)URn?(;RK;IE)r)<;AAfQVKu#l%0)W0YLlBjhXjb46)FReDW1V23 zpn*TjOBM19seEyPO$jmO#AnW=&ZI>9IU&yE9}h%WgQEAih)#(IFx7TN zj2JvI91un6bm$=T9IEt+gio^(o9t%P{0DDU6DPS5!R^apB1qaLU^M4h=@*#BO}DuGKo)nQV?sT#giP7LE)15 zkW5CWb=r>Lpr^{EQZ-eoERKzgji(Cfg;A&#EBWPOHsjJpfAs7H_w?vP?u0k)jkw8` zLcUrpWRuxqCZ8^%onFXK6;>Y{cazI*@*GAi6-&u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MPPio8|wK z8>024i^@~)*U_nTJ??!~s17!Xz0MdflQ8-pod35F2^5p|8wfWWzil4B8=OxjElHKH y#+7O}+oqI1wbK*#H9P4p)GVLE%)Li>!@U1XWN2cJ71h-&KgX9ZRllMz^Zx_VyRy{) literal 0 HcmV?d00001 diff --git a/lab1/kernel8.elf b/lab1/kernel8.elf new file mode 100755 index 0000000000000000000000000000000000000000..ce149d7dc8139a11b75c9d5bbd466e35b792ea2c GIT binary patch literal 80384 zcmeI3dvIJ=eaFwech729kJVa|CHWEiN_G+%M=RNJh#e$*ZRg<^vExSwU|6rDwY6lm zQdTQsW2Y7*ou(yBBbotbP@IsV#XP3tPD2|(pbnIlVVG%X%A;*cNfC(@GCcp%k025#WOn?b60Vco%m;e)C0!)AjFaajO1egF5U;<2l z2`~XBzyz286JP>NfC(@GCcp%k025#WOn?b60Vco%m;e)C0!)AjFaajO1egF5U;<2l z2`~XBzyz286JP>NfC(@GCcp%k025#WOn?b60Vco%m;e)C0!)AjFaajO1egF5U;<2l z2`~XBzyz286JP>NfC(@GCcp%k025#WOn?b60Vco%m;e)C0!)AjFaajO1egF5U;<2l z2`~XBzyz286JP>NfC(@GCcp%k025#WOn?b60Vco%m;e)C0!)AjFaajO1egF5U;<2l z2`~XBzyz286JP>NfC(@GCcp%k025#WOn?b60Vco%m;e)C0!)AjFaajO1egF5U;<2l z2`~XBzyz286JP>NfC(@GCcp%k025#WOn?b60Vco%m;e)C0!)AjFaajO1egF5U;<2l z2`~XBzyz286JP>NfC(@GCcp%k025#WOn?b60Vco%n85#?z-Pqf?{`GfAI}Q$e8%^_ zU#V2uvW|FQn-EiUeoct>j|j18+hgL*9T9QgbCt?%hg|X0FJUK=)NV{S?(1`9r}*A% zqnNo=CuU|F(=(Sm@rBvC^o%dW%xa3iQ%qg-GC#0(WFtg+#>%gr{@UlSdSVJOE?>%s zEv^tPgjKu zr+!>L{ncu|m9y^WD`&mWSJsHjLQWo>T_a}FV)CFbo-NI;7c;_z4Ea^|iy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{VngA(UB4o4$64DcmO6z4X`Bbei$1AaV0r3#N|{7Z=g)A)MeNqQ?Hkk1y( z^Kpq5^I75ORzt^es7Tqa)N(SQ(c zpM+eK-#cf|RsF013VTt10sj+NPg2LIf)7!-Jof~jp95x?*FZYQV(3*bI((`Z9IiK9 zTtUf2c`k>eka2lF{=1*}9CB<7*f=@e&&eK>Jcg?$#-E4r{|9WGom0WX=W_;UpU`K} z739U3eEwiFQ7_LEoTE;^ji23`8~vK}s}DK7JdxMevm{VBQ;R7gC;HD1?aO!XQVUu&hT7E090& z$3BZ-BpTHijrL2K$NoGFtr7s@4^H?L{LwF}CBKw80InKoq)fB`HHUJ%L?b&jY7^xaxscsuL_1ycHwM6009@zd0iYN3RWI4Dp{?I=~%6`SPOGZ$G0wA zRYDFF(7(Sd*RocVd&d}CooMQA77=VwPivw>u0|{uwfhtc(bkT(j>O&$u`AKu-qg|T z(5at#U}U@+A>Y2aMtM<4ez`0IR`jcFS2Mw?8NvD)_`wL%THF=DdCvG+;Cxl!UXQyB zy7LUIno)al%22_}KmH&sSRcnd4E<51-*mEYXzEU_p9Sm)?y}!(8{b{nU$nrJ@%M2L z17EB0jlh`?-xJzGw9|acv zZrg0f`LO?fmwpBG0sL?!l>UMEjapyt^55k0?}xq?{>xnc>$RTO{SNf?(64am8NUEL z4%}3@*r4n21@J+}F*^BrHYmahK)(RL@TYBW(tf<2h%28We4)Puy{@xd&qkMiA@qSe z`M6TA>DB&2Uk!bu;+Ols)#V?Dz8U&ME`8LcKLY(V=ylJ@de>_`yU0sF503c27z{|L e*QdsSmW3WW3lv_hWpjdky_R?A@u;?M(egjgo#k}^ literal 0 HcmV?d00001 diff --git a/lab1/lib/mbox.c b/lab1/lib/mbox.c index b20c3ec7f..b90809a02 100644 --- a/lab1/lib/mbox.c +++ b/lab1/lib/mbox.c @@ -21,19 +21,27 @@ int mbox_call(mail_t* mbox, uint8_t ch) { } void get_board_revision(uint32_t* board_revision) { + // Create a mailbox structure and initialize its fields mail_t mbox = { - .header.packet_size = MAIL_PACKET_SIZE, - .header.code = REQUEST_CODE, - .body.id = GET_BOARD_REVISION, - .body.buf_size = MAIL_BUF_SIZE, - .body.code = TAG_REQUEST_CODE, - .body.end = END_TAG, + .header.packet_size = MAIL_PACKET_SIZE, // Set the packet size in the header + .header.code = REQUEST_CODE, // Set the code in the header to indicate a request + .body.id = GET_BOARD_REVISION, // Set the ID of the body to get board revision + .body.buf_size = MAIL_BUF_SIZE, // Set the size of the buffer in the body + .body.code = TAG_REQUEST_CODE, // Set the code in the body to indicate a tag request + .body.end = END_TAG, // Set the end tag in the body }; - for (uint32_t i = 0; i < MAIL_BODY_BUF_LEN; i++) mbox.body.buf[i] = 0; + // Initialize the buffer in the body to 0 + for (uint32_t i = 0; i < MAIL_BODY_BUF_LEN; i++) { + mbox.body.buf[i] = 0; + } + // Call the mailbox function to send the request and receive the response + // MBOX_CH_PROP means chennel 8 mbox_call(&mbox, MBOX_CH_PROP); + // Extract the board revision information from the response buffer and assign it to board_revision *board_revision = mbox.body.buf[0]; } + From 7db15089f7882b7505ef8b723193d595d8de94fc Mon Sep 17 00:00:00 2001 From: root Date: Fri, 8 Mar 2024 11:40:06 +0800 Subject: [PATCH 06/10] Finish Mailbox, but have small bug. --- lab1/lib/include/mbox.h | 2 ++ lab1/lib/include/shell.h | 3 +- lab1/lib/mbox.c | 63 ++++++++++++++++++++++++++++++++++++---- lab1/lib/shell.c | 14 ++++++++- 4 files changed, 74 insertions(+), 8 deletions(-) diff --git a/lab1/lib/include/mbox.h b/lab1/lib/include/mbox.h index 67ea2f922..8dc9ed9fc 100644 --- a/lab1/lib/include/mbox.h +++ b/lab1/lib/include/mbox.h @@ -104,6 +104,8 @@ typedef struct mail_t { int mbox_call(mail_t* mbox, uint8_t ch); void get_board_revision(uint32_t* board_revision); +void get_memory_info(uint32_t* mem_base, uint32_t* mem_size); +void get_board_serial(uint32_t* msb, uint32_t* lsb); #endif \ No newline at end of file diff --git a/lab1/lib/include/shell.h b/lab1/lib/include/shell.h index 453676ae1..4edadbc20 100644 --- a/lab1/lib/include/shell.h +++ b/lab1/lib/include/shell.h @@ -26,6 +26,7 @@ struct func func_list[] = { {.name = "help", .ptr = cmd_help, .desc = "print this help menu"}, {.name = "hello", .ptr = cmd_hello, .desc = "print Hello World!"}, {.name = "reboot", .ptr = cmd_help, .desc = "reboot the device"}, - {.name = "sysinfo", .ptr = cmd_sysinfo, .desc = "get system info"}}; + {.name = "sysinfo", .ptr = cmd_sysinfo, .desc = "get system info"}, + {.name = "123", .ptr = cmd_hello, .desc = "???"}}; #endif \ No newline at end of file diff --git a/lab1/lib/mbox.c b/lab1/lib/mbox.c index b90809a02..0b63e94db 100644 --- a/lab1/lib/mbox.c +++ b/lab1/lib/mbox.c @@ -3,20 +3,24 @@ int mbox_call(mail_t* mbox, uint8_t ch) { uint32_t addr_channel; - // 1. Read the status register until the empty flag is not set + // 1. Combine the message address (upper 28 bits) with channel number (lower 4 bits) + addr_channel = (((uint32_t)(uint64_t)mbox) & 0xFFFFFFF0) | (ch & 0xF); + + // 2. Read the status register until the empty flag is not set, then break while while (mmio_read(MBOX_STATUS) & MBOX_FULL) asm volatile("nop"); - // 2. Write the data (shifted into the uppper 28 bits) combined with - // the channel (in the lower four bits) to the write register - addr_channel = (((uint32_t)(uint64_t)mbox) & 0xFFFFFFF0) | (ch & 0xF); + // 3. If not, then you can write to Mailbox 1 Read/Write register. mmio_write(MBOX_WRITE, addr_channel); - // Wait for mbox response + // 4. Check if Mailbox 0 status register’s empty flag is set. + // 5. Read from Mailbox 0 Read/Write register. do { while (mmio_read(MBOX_STATUS) & MBOX_EMPTY) asm volatile("nop"); } while (mmio_read(MBOX_READ) != addr_channel); - /* check response vaild */ + + // 6. And check if the value is the same as you wrote in step 1. + // 0x80000000: request successfu return mbox->header.code == MBOX_RESPONSE; } @@ -45,3 +49,50 @@ void get_board_revision(uint32_t* board_revision) { } +// Get ARM memory Response:Length: 8 +void get_memory_info(uint32_t* mem_base, uint32_t* mem_size) { + mail_t mbox = { + .header.packet_size = MAIL_PACKET_SIZE, + .header.code = REQUEST_CODE, + .body.id = GET_ARM_MEMORY, + .body.buf_size = MAIL_BUF_SIZE, + .body.code = TAG_REQUEST_CODE, + .body.end = END_TAG, + }; + + for (uint32_t i = 0; i < MAIL_BODY_BUF_LEN; i++) mbox.body.buf[i] = 0; + + if (mbox_call(&mbox, MBOX_CH_PROP)) { + *mem_base = mbox.body.buf[0]; // u32: base address in bytes + *mem_size = mbox.body.buf[1]; // u32: size in bytes + + } else { + *mem_size = 0xFFFFFFFF; + *mem_base = 0xFFFFFFFF; + } +} + + +// Get board serial : Response:Length: 8 u64: board serial +void get_board_serial(uint32_t* msb, uint32_t* lsb) { + mail_t mbox = { + .header.packet_size = MAIL_PACKET_SIZE, + .header.code = REQUEST_CODE, + .body.id = GET_BOARD_SERIAL, + .body.buf_size = MAIL_BUF_SIZE, + .body.code = TAG_REQUEST_CODE, + .body.end = END_TAG, + }; + + for (uint32_t i = 0; i < MAIL_BODY_BUF_LEN; i++) mbox.body.buf[i] = 0; + + if (mbox_call(&mbox, MBOX_CH_PROP)) { + *msb = mbox.body.buf[1]; + *lsb = mbox.body.buf[0]; + } else { + *msb = 0xFFFFFFFF; + *lsb = 0xFFFFFFFF; + } +} + + diff --git a/lab1/lib/shell.c b/lab1/lib/shell.c index 711c78ebd..fac49825f 100644 --- a/lab1/lib/shell.c +++ b/lab1/lib/shell.c @@ -63,6 +63,10 @@ void cmd_help() { void cmd_hello() { uart_write_string("Hello World!" ENDL); + uart_write_string(func_list[0].name); + uart_write_string(func_list[1].name); + uart_write_string(func_list[2].name); + uart_write_string(func_list[3].desc); } @@ -79,7 +83,15 @@ void cmd_sysinfo() { uart_puth(*board_revision); uart_write_string(ENDL); - + // Memory Info + get_memory_info(mem_base, mem_size); + uart_write_string("Memroy Base Address : 0x"); + uart_puth(*mem_base); + uart_write_string(ENDL); + + uart_write_string("Memory Size : 0x"); + uart_puth(*mem_size); + uart_write_string(ENDL); } void cmd_unknown() { From 239c520e45a5110920fca56653700be3878d30c3 Mon Sep 17 00:00:00 2001 From: root Date: Fri, 8 Mar 2024 13:53:49 +0800 Subject: [PATCH 07/10] Finish Reboot --- lab1/build/app/boot.o | Bin 2400 -> 0 bytes lab1/build/app/main.o | Bin 3192 -> 0 bytes lab1/build/kernel8.objdump | 669 ------------------------------------- lab1/build/lib/mbox.o | Bin 4872 -> 0 bytes lab1/build/lib/mmio.o | Bin 3096 -> 0 bytes lab1/build/lib/shell.o | Bin 11328 -> 0 bytes lab1/build/lib/uart.o | Bin 6160 -> 0 bytes lab1/kernel8.elf | Bin 80384 -> 0 bytes lab1/kernel8.img | Bin 5464 -> 0 bytes lab1/lib/include/reset.h | 19 ++ lab1/lib/include/shell.h | 8 +- lab1/lib/shell.c | 13 +- lab1/lib/uart.c | 10 +- 13 files changed, 34 insertions(+), 685 deletions(-) delete mode 100644 lab1/build/app/boot.o delete mode 100644 lab1/build/app/main.o delete mode 100644 lab1/build/kernel8.objdump delete mode 100644 lab1/build/lib/mbox.o delete mode 100644 lab1/build/lib/mmio.o delete mode 100644 lab1/build/lib/shell.o delete mode 100644 lab1/build/lib/uart.o delete mode 100755 lab1/kernel8.elf delete mode 100755 lab1/kernel8.img create mode 100644 lab1/lib/include/reset.h diff --git a/lab1/build/app/boot.o b/lab1/build/app/boot.o deleted file mode 100644 index c9c01fc536a16fd505aa09b3a6b20a67478b34fd..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2400 zcmbtW&2G~`5FW>&v_L~jk*J73b{l?#kkf`BaX_kDiNXO;p{m3Q*CwV!q=|403S6iV zH!cNn;0T;}03>*k@&LR85)y|nCbFTmz%dg@0Y7y>y9t-HYh7we5$+YgrD z`t40?Wy7jFml`QO(=szpfc9m$=#e-RXR^eE;utKpV;mPq5w2Ih95zsoUyKh2|h-L*&O_I4i42mRGZ*=L9gfaVn2%6ZoLTMaTs;NwzuQA zIWd%33td!?{EFgYV!Ch(7tyWikL%~Z5pKdY<@zqn~ouvFzf|881KO}^!r@+1G zdFBLtn4j;pC2`85oVpeX6%5uOD!F&v#-!KpjUyKVmBm`!P68 zKlZ`F;{hiM+rC4nL(fk7%`kYn?X_E-a0F;|9(FM}ne>Ao3ZIQk`;p(-4l$=-U`e@v z|5O!>$1Mcj2Ttd*p=si(VxvQt{=!|Aq}Y1=Ih>jHR4;{quc6N+RkR6F}cj zy0fPTN0!@Pdtw2d%1#`z9tIUqXA`2sNtw{=^bX(|0wHo9jZ@j)a&0xOwWlB z{Gb8F5o$Q<+*>%4RsXxJ|3yYpeX6b3zmJ%nlR}CTJWh@xI`;|A=@`*12`(zJWb(UY zxQ#|u|62s2a6I)-?_TeJ7cnZuJTwzom-WvwAT{@@>a4$deM$HrHGO00d#cx`Z=-(q esZ?2l{Cy>igzE|q@PC}__&vG)H%ydTkN*q$u6;TH diff --git a/lab1/build/app/main.o b/lab1/build/app/main.o deleted file mode 100644 index 5c9515be864685d4710cefa2a58e76c30dbbfae3..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3192 zcmbVO&2Jl35TEsWlNh&d6BpWGAPWkRB6ed(X`!VBw-GIs5L8IHaEaFT#$I*38||*C zOA&B{V1WRsG!2+E_y%@0MgfM?yK+;AO*jNq*tz=c7dtv!`+Whn|ER(CpNC-^&2Q0X!PI}+ zx%%CWTl&V&pCV8caWf+QJ|SnmmNIgIWX+gjh;7=3?;@l}bu`vUEL?jMZ^djmgHAg-a61cLcziUKGV4KGO0byj<@QZ4J1T4h$7n?86LOW4{| z^LpiE`HAw0^2754H;=q?c3!LENes|uQp<&E;RxOk0qL3oMmG9F^^^#kLQj}hEqItk zD3_na>HsAv&YXI7;uD?Nd1USF8 zcG6s0Zw-QEke<|P420Hrb)|0CSM8OfDK5HkP<&&HUVZ_J!~3+_z6CH5qen#~nti5X zepI}!Kl9tK_=x_WsN+TW``~S894^7_#Pv4xZF&%}y@`$<5x(iuPr#}ZDA1rpz z;SLtZxDFFQJTG_}n#Yb+!)A1>v)q!o0Hzh-X&jsAGgvS4|niv5bE$@jE4FT&gfH1$w1N zZ!cm;GyWxZMs8ypDl|F6}k<`MLh*q-03-ZJ;gh{ukx_O&LJE(lnkl99kk`u|5(=NIidQrchvd=#3(19 z6GcIXd0m->O^Vbp2i~mK&^WNYz9LJpY7R&5Iyr>SOG^)PzkCHH1PI}=zW&GnK zBo+An48Mm$UjJ_9^pAceIiCBPSDSJ-W&N+@f#(p*i>Kd+ysQ32heCQJWutHP{`6e) P;(w6mzcGqT1vUOZ%kA&l diff --git a/lab1/build/kernel8.objdump b/lab1/build/kernel8.objdump deleted file mode 100644 index 5ba56ca61..000000000 --- a/lab1/build/kernel8.objdump +++ /dev/null @@ -1,669 +0,0 @@ - -kernel8.elf: file format elf64-littleaarch64 - - -Disassembly of section .text: - -0000000000080000 <__start>: - 80000: d53800a1 mrs x1, mpidr_el1 - 80004: 92400421 and x1, x1, #0x3 - 80008: b4000061 cbz x1, 80014 <__start+0x14> - 8000c: d503205f wfe - 80010: 17ffffff b 8000c <__start+0xc> - 80014: 58000161 ldr x1, 80040 <__start+0x40> - 80018: 9100003f mov sp, x1 - 8001c: 58000161 ldr x1, 80048 <__start+0x48> - 80020: 180000e2 ldr w2, 8003c <__start+0x3c> - 80024: 34000082 cbz w2, 80034 <__start+0x34> - 80028: f800843f str xzr, [x1], #8 - 8002c: 51000442 sub w2, w2, #0x1 - 80030: 35ffffa2 cbnz w2, 80024 <__start+0x24> - 80034: 94000253 bl 80980 - 80038: 17fffff5 b 8000c <__start+0xc> - 8003c: 00001000 .word 0x00001000 - 80040: 00080000 .word 0x00080000 - 80044: 00000000 .word 0x00000000 - 80048: 00082000 .word 0x00082000 - 8004c: 00000000 .word 0x00000000 - -0000000000080050 : - 80050: d10043ff sub sp, sp, #0x10 - 80054: b9000fe0 str w0, [sp, #12] - 80058: b9000be1 str w1, [sp, #8] - 8005c: b9400fe0 ldr w0, [sp, #12] - 80060: aa0003e1 mov x1, x0 - 80064: b9400be0 ldr w0, [sp, #8] - 80068: b9000020 str w0, [x1] - 8006c: d503201f nop - 80070: 910043ff add sp, sp, #0x10 - 80074: d65f03c0 ret - -0000000000080078 : - 80078: d10043ff sub sp, sp, #0x10 - 8007c: b9000fe0 str w0, [sp, #12] - 80080: b9400fe0 ldr w0, [sp, #12] - 80084: b9400000 ldr w0, [x0] - 80088: 910043ff add sp, sp, #0x10 - 8008c: d65f03c0 ret - -0000000000080090 : - 80090: a9bd7bfd stp x29, x30, [sp, #-48]! - 80094: 910003fd mov x29, sp - 80098: f9000fe0 str x0, [sp, #24] - 8009c: 39005fe1 strb w1, [sp, #23] - 800a0: 14000002 b 800a8 - 800a4: d503201f nop - 800a8: 52971300 mov w0, #0xb898 // #47256 - 800ac: 72a7e000 movk w0, #0x3f00, lsl #16 - 800b0: 97fffff2 bl 80078 - 800b4: 7100001f cmp w0, #0x0 - 800b8: 54ffff6b b.lt 800a4 // b.tstop - 800bc: f9400fe0 ldr x0, [sp, #24] - 800c0: 121c6c01 and w1, w0, #0xfffffff0 - 800c4: 39405fe0 ldrb w0, [sp, #23] - 800c8: 12000c00 and w0, w0, #0xf - 800cc: 2a000020 orr w0, w1, w0 - 800d0: b9002fe0 str w0, [sp, #44] - 800d4: b9402fe1 ldr w1, [sp, #44] - 800d8: 52971400 mov w0, #0xb8a0 // #47264 - 800dc: 72a7e000 movk w0, #0x3f00, lsl #16 - 800e0: 97ffffdc bl 80050 - 800e4: 14000002 b 800ec - 800e8: d503201f nop - 800ec: 52971300 mov w0, #0xb898 // #47256 - 800f0: 72a7e000 movk w0, #0x3f00, lsl #16 - 800f4: 97ffffe1 bl 80078 - 800f8: 12020000 and w0, w0, #0x40000000 - 800fc: 7100001f cmp w0, #0x0 - 80100: 54ffff41 b.ne 800e8 // b.any - 80104: 52971000 mov w0, #0xb880 // #47232 - 80108: 72a7e000 movk w0, #0x3f00, lsl #16 - 8010c: 97ffffdb bl 80078 - 80110: 2a0003e1 mov w1, w0 - 80114: b9402fe0 ldr w0, [sp, #44] - 80118: 6b01001f cmp w0, w1 - 8011c: 54fffe81 b.ne 800ec // b.any - 80120: f9400fe0 ldr x0, [sp, #24] - 80124: b9400401 ldr w1, [x0, #4] - 80128: 52b00000 mov w0, #0x80000000 // #-2147483648 - 8012c: 6b00003f cmp w1, w0 - 80130: 1a9f17e0 cset w0, eq // eq = none - 80134: 12001c00 and w0, w0, #0xff - 80138: a8c37bfd ldp x29, x30, [sp], #48 - 8013c: d65f03c0 ret - -0000000000080140 : - 80140: a9bb7bfd stp x29, x30, [sp, #-80]! - 80144: 910003fd mov x29, sp - 80148: f9000fe0 str x0, [sp, #24] - 8014c: a9027fff stp xzr, xzr, [sp, #32] - 80150: a9037fff stp xzr, xzr, [sp, #48] - 80154: f90023ff str xzr, [sp, #64] - 80158: 52800500 mov w0, #0x28 // #40 - 8015c: b90023e0 str w0, [sp, #32] - 80160: 52800040 mov w0, #0x2 // #2 - 80164: 72a00020 movk w0, #0x1, lsl #16 - 80168: b9002be0 str w0, [sp, #40] - 8016c: 52800200 mov w0, #0x10 // #16 - 80170: b9002fe0 str w0, [sp, #44] - 80174: b9004fff str wzr, [sp, #76] - 80178: 14000008 b 80198 - 8017c: b9404fe0 ldr w0, [sp, #76] - 80180: d37ef400 lsl x0, x0, #2 - 80184: 9100d3e1 add x1, sp, #0x34 - 80188: b820683f str wzr, [x1, x0] - 8018c: b9404fe0 ldr w0, [sp, #76] - 80190: 11000400 add w0, w0, #0x1 - 80194: b9004fe0 str w0, [sp, #76] - 80198: b9404fe0 ldr w0, [sp, #76] - 8019c: 71000c1f cmp w0, #0x3 - 801a0: 54fffee9 b.ls 8017c // b.plast - 801a4: 910083e0 add x0, sp, #0x20 - 801a8: 52800101 mov w1, #0x8 // #8 - 801ac: 97ffffb9 bl 80090 - 801b0: b9402be0 ldr w0, [sp, #40] - 801b4: 940001bb bl 808a0 - 801b8: b94037e1 ldr w1, [sp, #52] - 801bc: f9400fe0 ldr x0, [sp, #24] - 801c0: b9000001 str w1, [x0] - 801c4: d503201f nop - 801c8: a8c57bfd ldp x29, x30, [sp], #80 - 801cc: d65f03c0 ret - -00000000000801d0 : - 801d0: d10083ff sub sp, sp, #0x20 - 801d4: f90007e0 str x0, [sp, #8] - 801d8: f90003e1 str x1, [sp] - 801dc: b9001fff str wzr, [sp, #28] - 801e0: 14000004 b 801f0 - 801e4: b9401fe0 ldr w0, [sp, #28] - 801e8: 11000400 add w0, w0, #0x1 - 801ec: b9001fe0 str w0, [sp, #28] - 801f0: b9401fe0 ldr w0, [sp, #28] - 801f4: f94007e1 ldr x1, [sp, #8] - 801f8: 8b000020 add x0, x1, x0 - 801fc: 39400001 ldrb w1, [x0] - 80200: b9401fe0 ldr w0, [sp, #28] - 80204: f94003e2 ldr x2, [sp] - 80208: 8b000040 add x0, x2, x0 - 8020c: 39400000 ldrb w0, [x0] - 80210: 6b00003f cmp w1, w0 - 80214: 540001a1 b.ne 80248 // b.any - 80218: b9401fe0 ldr w0, [sp, #28] - 8021c: f94007e1 ldr x1, [sp, #8] - 80220: 8b000020 add x0, x1, x0 - 80224: 39400000 ldrb w0, [x0] - 80228: 7100001f cmp w0, #0x0 - 8022c: 540000e0 b.eq 80248 // b.none - 80230: b9401fe0 ldr w0, [sp, #28] - 80234: f94003e1 ldr x1, [sp] - 80238: 8b000020 add x0, x1, x0 - 8023c: 39400000 ldrb w0, [x0] - 80240: 7100001f cmp w0, #0x0 - 80244: 54fffd01 b.ne 801e4 // b.any - 80248: b9401fe0 ldr w0, [sp, #28] - 8024c: f94007e1 ldr x1, [sp, #8] - 80250: 8b000020 add x0, x1, x0 - 80254: 39400000 ldrb w0, [x0] - 80258: 2a0003e2 mov w2, w0 - 8025c: b9401fe0 ldr w0, [sp, #28] - 80260: f94003e1 ldr x1, [sp] - 80264: 8b000020 add x0, x1, x0 - 80268: 39400000 ldrb w0, [x0] - 8026c: 4b000040 sub w0, w2, w0 - 80270: 910083ff add sp, sp, #0x20 - 80274: d65f03c0 ret - -0000000000080278 : - 80278: d10083ff sub sp, sp, #0x20 - 8027c: f90007e0 str x0, [sp, #8] - 80280: b9001fff str wzr, [sp, #28] - 80284: b9401fe0 ldr w0, [sp, #28] - 80288: f94007e1 ldr x1, [sp, #8] - 8028c: 8b000020 add x0, x1, x0 - 80290: 39400000 ldrb w0, [x0] - 80294: 7100001f cmp w0, #0x0 - 80298: 54000061 b.ne 802a4 // b.any - 8029c: b9401fe0 ldr w0, [sp, #28] - 802a0: 14000005 b 802b4 - 802a4: b9401fe0 ldr w0, [sp, #28] - 802a8: 11000400 add w0, w0, #0x1 - 802ac: b9001fe0 str w0, [sp, #28] - 802b0: 17fffff5 b 80284 - 802b4: 910083ff add sp, sp, #0x20 - 802b8: d65f03c0 ret - -00000000000802bc : - 802bc: a9bf7bfd stp x29, x30, [sp, #-16]! - 802c0: 910003fd mov x29, sp - 802c4: b0000000 adrp x0, 81000 <__text_end> - 802c8: 9101e000 add x0, x0, #0x78 - 802cc: 94000175 bl 808a0 - 802d0: d503201f nop - 802d4: a8c17bfd ldp x29, x30, [sp], #16 - 802d8: d65f03c0 ret - -00000000000802dc : - 802dc: a9be7bfd stp x29, x30, [sp, #-32]! - 802e0: 910003fd mov x29, sp - 802e4: b0000000 adrp x0, 81000 <__text_end> - 802e8: 91070000 add x0, x0, #0x1c0 - 802ec: 9400016d bl 808a0 - 802f0: b9001fff str wzr, [sp, #28] - 802f4: 1400002b b 803a0 - 802f8: 39406fe0 ldrb w0, [sp, #27] - 802fc: 94000134 bl 807cc - 80300: 39406fe0 ldrb w0, [sp, #27] - 80304: 7101fc1f cmp w0, #0x7f - 80308: 540001e0 b.eq 80344 // b.none - 8030c: 7101fc1f cmp w0, #0x7f - 80310: 5400036c b.gt 8037c - 80314: 7100281f cmp w0, #0xa - 80318: 54000060 b.eq 80324 // b.none - 8031c: 7100341f cmp w0, #0xd - 80320: 540002e1 b.ne 8037c // b.any - 80324: b9401fe0 ldr w0, [sp, #28] - 80328: 11000401 add w1, w0, #0x1 - 8032c: b9001fe1 str w1, [sp, #28] - 80330: b0000001 adrp x1, 81000 <__text_end> - 80334: f9426c21 ldr x1, [x1, #1240] - 80338: 2a0003e0 mov w0, w0 - 8033c: 3820683f strb wzr, [x1, x0] - 80340: 1400001d b 803b4 - 80344: b9401fe0 ldr w0, [sp, #28] - 80348: 7100001f cmp w0, #0x0 - 8034c: 540002a0 b.eq 803a0 // b.none - 80350: b9401fe0 ldr w0, [sp, #28] - 80354: 51000400 sub w0, w0, #0x1 - 80358: b9001fe0 str w0, [sp, #28] - 8035c: b0000000 adrp x0, 81000 <__text_end> - 80360: f9426c01 ldr x1, [x0, #1240] - 80364: b9401fe0 ldr w0, [sp, #28] - 80368: 3820683f strb wzr, [x1, x0] - 8036c: b0000000 adrp x0, 81000 <__text_end> - 80370: 91072000 add x0, x0, #0x1c8 - 80374: 9400014b bl 808a0 - 80378: 1400000a b 803a0 - 8037c: b9401fe0 ldr w0, [sp, #28] - 80380: 11000401 add w1, w0, #0x1 - 80384: b9001fe1 str w1, [sp, #28] - 80388: b0000001 adrp x1, 81000 <__text_end> - 8038c: f9426c21 ldr x1, [x1, #1240] - 80390: 2a0003e0 mov w0, w0 - 80394: 39406fe2 ldrb w2, [sp, #27] - 80398: 38206822 strb w2, [x1, x0] - 8039c: d503201f nop - 803a0: 9400011f bl 8081c - 803a4: 39006fe0 strb w0, [sp, #27] - 803a8: 39406fe0 ldrb w0, [sp, #27] - 803ac: 7100001f cmp w0, #0x0 - 803b0: 54fffa41 b.ne 802f8 // b.any - 803b4: a8c27bfd ldp x29, x30, [sp], #32 - 803b8: d65f03c0 ret - -00000000000803bc : - 803bc: a9be7bfd stp x29, x30, [sp, #-32]! - 803c0: 910003fd mov x29, sp - 803c4: b0000000 adrp x0, 81000 <__text_end> - 803c8: f9426c00 ldr x0, [x0, #1240] - 803cc: 97ffffab bl 80278 - 803d0: 7100001f cmp w0, #0x0 - 803d4: 540004a0 b.eq 80468 // b.none - 803d8: b9001fff str wzr, [sp, #28] - 803dc: 1400001e b 80454 - 803e0: b0000000 adrp x0, 81000 <__text_end> - 803e4: 9113e002 add x2, x0, #0x4f8 - 803e8: b9401fe1 ldr w1, [sp, #28] - 803ec: aa0103e0 mov x0, x1 - 803f0: d37ff800 lsl x0, x0, #1 - 803f4: 8b010000 add x0, x0, x1 - 803f8: d37df000 lsl x0, x0, #3 - 803fc: 8b000040 add x0, x2, x0 - 80400: f9400000 ldr x0, [x0] - 80404: aa0003e1 mov x1, x0 - 80408: b0000000 adrp x0, 81000 <__text_end> - 8040c: f9426c00 ldr x0, [x0, #1240] - 80410: 97ffff70 bl 801d0 - 80414: 7100001f cmp w0, #0x0 - 80418: 54000181 b.ne 80448 // b.any - 8041c: b0000000 adrp x0, 81000 <__text_end> - 80420: 9113e002 add x2, x0, #0x4f8 - 80424: b9401fe1 ldr w1, [sp, #28] - 80428: aa0103e0 mov x0, x1 - 8042c: d37ff800 lsl x0, x0, #1 - 80430: 8b010000 add x0, x0, x1 - 80434: d37df000 lsl x0, x0, #3 - 80438: 8b000040 add x0, x2, x0 - 8043c: f9400400 ldr x0, [x0, #8] - 80440: d63f0000 blr x0 - 80444: 1400000a b 8046c - 80448: b9401fe0 ldr w0, [sp, #28] - 8044c: 11000400 add w0, w0, #0x1 - 80450: b9001fe0 str w0, [sp, #28] - 80454: b9401fe0 ldr w0, [sp, #28] - 80458: 71000c1f cmp w0, #0x3 - 8045c: 54fffc29 b.ls 803e0 // b.plast - 80460: 9400005e bl 805d8 - 80464: 14000002 b 8046c - 80468: d503201f nop - 8046c: a8c27bfd ldp x29, x30, [sp], #32 - 80470: d65f03c0 ret - -0000000000080474 : - 80474: a9be7bfd stp x29, x30, [sp, #-32]! - 80478: 910003fd mov x29, sp - 8047c: b9001fff str wzr, [sp, #28] - 80480: 14000035 b 80554 - 80484: b0000000 adrp x0, 81000 <__text_end> - 80488: 9113e002 add x2, x0, #0x4f8 - 8048c: b9401fe1 ldr w1, [sp, #28] - 80490: aa0103e0 mov x0, x1 - 80494: d37ff800 lsl x0, x0, #1 - 80498: 8b010000 add x0, x0, x1 - 8049c: d37df000 lsl x0, x0, #3 - 804a0: 8b000040 add x0, x2, x0 - 804a4: f9400000 ldr x0, [x0] - 804a8: 940000fe bl 808a0 - 804ac: b9001bff str wzr, [sp, #24] - 804b0: 14000006 b 804c8 - 804b4: 52800400 mov w0, #0x20 // #32 - 804b8: 940000c5 bl 807cc - 804bc: b9401be0 ldr w0, [sp, #24] - 804c0: 11000400 add w0, w0, #0x1 - 804c4: b9001be0 str w0, [sp, #24] - 804c8: b0000000 adrp x0, 81000 <__text_end> - 804cc: 9113e002 add x2, x0, #0x4f8 - 804d0: b9401fe1 ldr w1, [sp, #28] - 804d4: aa0103e0 mov x0, x1 - 804d8: d37ff800 lsl x0, x0, #1 - 804dc: 8b010000 add x0, x0, x1 - 804e0: d37df000 lsl x0, x0, #3 - 804e4: 8b000040 add x0, x2, x0 - 804e8: f9400000 ldr x0, [x0] - 804ec: 97ffff63 bl 80278 - 804f0: 2a0003e1 mov w1, w0 - 804f4: 52800140 mov w0, #0xa // #10 - 804f8: 4b010000 sub w0, w0, w1 - 804fc: b9401be1 ldr w1, [sp, #24] - 80500: 6b00003f cmp w1, w0 - 80504: 54fffd83 b.cc 804b4 // b.lo, b.ul, b.last - 80508: b0000000 adrp x0, 81000 <__text_end> - 8050c: 91074000 add x0, x0, #0x1d0 - 80510: 940000e4 bl 808a0 - 80514: b0000000 adrp x0, 81000 <__text_end> - 80518: 9113e002 add x2, x0, #0x4f8 - 8051c: b9401fe1 ldr w1, [sp, #28] - 80520: aa0103e0 mov x0, x1 - 80524: d37ff800 lsl x0, x0, #1 - 80528: 8b010000 add x0, x0, x1 - 8052c: d37df000 lsl x0, x0, #3 - 80530: 8b000040 add x0, x2, x0 - 80534: f9400800 ldr x0, [x0, #16] - 80538: 940000da bl 808a0 - 8053c: b0000000 adrp x0, 81000 <__text_end> - 80540: 91076000 add x0, x0, #0x1d8 - 80544: 940000d7 bl 808a0 - 80548: b9401fe0 ldr w0, [sp, #28] - 8054c: 11000400 add w0, w0, #0x1 - 80550: b9001fe0 str w0, [sp, #28] - 80554: b9401fe0 ldr w0, [sp, #28] - 80558: 71000c1f cmp w0, #0x3 - 8055c: 54fff949 b.ls 80484 // b.plast - 80560: d503201f nop - 80564: d503201f nop - 80568: a8c27bfd ldp x29, x30, [sp], #32 - 8056c: d65f03c0 ret - -0000000000080570 : - 80570: a9bf7bfd stp x29, x30, [sp, #-16]! - 80574: 910003fd mov x29, sp - 80578: b0000000 adrp x0, 81000 <__text_end> - 8057c: 91078000 add x0, x0, #0x1e0 - 80580: 940000c8 bl 808a0 - 80584: d503201f nop - 80588: a8c17bfd ldp x29, x30, [sp], #16 - 8058c: d65f03c0 ret - -0000000000080590 : - 80590: a9be7bfd stp x29, x30, [sp, #-32]! - 80594: 910003fd mov x29, sp - 80598: 52800280 mov w0, #0x14 // #20 - 8059c: b9001fe0 str w0, [sp, #28] - 805a0: f9400be0 ldr x0, [sp, #16] - 805a4: 97fffee7 bl 80140 - 805a8: b0000000 adrp x0, 81000 <__text_end> - 805ac: 9107c000 add x0, x0, #0x1f0 - 805b0: 940000bc bl 808a0 - 805b4: f9400be0 ldr x0, [sp, #16] - 805b8: b9400000 ldr w0, [x0] - 805bc: 940000d0 bl 808fc - 805c0: b0000000 adrp x0, 81000 <__text_end> - 805c4: 91076000 add x0, x0, #0x1d8 - 805c8: 940000b6 bl 808a0 - 805cc: d503201f nop - 805d0: a8c27bfd ldp x29, x30, [sp], #32 - 805d4: d65f03c0 ret - -00000000000805d8 : - 805d8: a9bf7bfd stp x29, x30, [sp, #-16]! - 805dc: 910003fd mov x29, sp - 805e0: b0000000 adrp x0, 81000 <__text_end> - 805e4: 91084000 add x0, x0, #0x210 - 805e8: 940000ae bl 808a0 - 805ec: b0000000 adrp x0, 81000 <__text_end> - 805f0: f9426c00 ldr x0, [x0, #1240] - 805f4: 940000ab bl 808a0 - 805f8: b0000000 adrp x0, 81000 <__text_end> - 805fc: 91076000 add x0, x0, #0x1d8 - 80600: 940000a8 bl 808a0 - 80604: d503201f nop - 80608: a8c17bfd ldp x29, x30, [sp], #16 - 8060c: d65f03c0 ret - -0000000000080610 : - 80610: a9bf7bfd stp x29, x30, [sp, #-16]! - 80614: 910003fd mov x29, sp - 80618: 97ffff29 bl 802bc - 8061c: 97ffff30 bl 802dc - 80620: b0000000 adrp x0, 81000 <__text_end> - 80624: 91070000 add x0, x0, #0x1c0 - 80628: 9400009e bl 808a0 - 8062c: b0000000 adrp x0, 81000 <__text_end> - 80630: f9426c00 ldr x0, [x0, #1240] - 80634: 9400009b bl 808a0 - 80638: b0000000 adrp x0, 81000 <__text_end> - 8063c: 91076000 add x0, x0, #0x1d8 - 80640: 94000098 bl 808a0 - 80644: 97ffff5e bl 803bc - 80648: 17fffff5 b 8061c - -000000000008064c : - 8064c: d10083ff sub sp, sp, #0x20 - 80650: b9000fe0 str w0, [sp, #12] - 80654: b9001fff str wzr, [sp, #28] - 80658: 14000005 b 8066c - 8065c: d503201f nop - 80660: b9401fe0 ldr w0, [sp, #28] - 80664: 11000400 add w0, w0, #0x1 - 80668: b9001fe0 str w0, [sp, #28] - 8066c: b9401fe1 ldr w1, [sp, #28] - 80670: b9400fe0 ldr w0, [sp, #12] - 80674: 6b00003f cmp w1, w0 - 80678: 54ffff23 b.cc 8065c // b.lo, b.ul, b.last - 8067c: d503201f nop - 80680: d503201f nop - 80684: 910083ff add sp, sp, #0x20 - 80688: d65f03c0 ret - -000000000008068c : - 8068c: a9be7bfd stp x29, x30, [sp, #-32]! - 80690: 910003fd mov x29, sp - 80694: 52800080 mov w0, #0x4 // #4 - 80698: 72a7e400 movk w0, #0x3f20, lsl #16 - 8069c: 97fffe77 bl 80078 - 806a0: b9001fe0 str w0, [sp, #28] - 806a4: b9401fe0 ldr w0, [sp, #28] - 806a8: 12117000 and w0, w0, #0xffff8fff - 806ac: b9001fe0 str w0, [sp, #28] - 806b0: b9401fe0 ldr w0, [sp, #28] - 806b4: 32130000 orr w0, w0, #0x2000 - 806b8: b9001fe0 str w0, [sp, #28] - 806bc: b9401fe0 ldr w0, [sp, #28] - 806c0: 120e7000 and w0, w0, #0xfffc7fff - 806c4: b9001fe0 str w0, [sp, #28] - 806c8: b9401fe0 ldr w0, [sp, #28] - 806cc: 32100000 orr w0, w0, #0x10000 - 806d0: b9001fe0 str w0, [sp, #28] - 806d4: b9401fe1 ldr w1, [sp, #28] - 806d8: 52800080 mov w0, #0x4 // #4 - 806dc: 72a7e400 movk w0, #0x3f20, lsl #16 - 806e0: 97fffe5c bl 80050 - 806e4: 52800001 mov w1, #0x0 // #0 - 806e8: 52801280 mov w0, #0x94 // #148 - 806ec: 72a7e400 movk w0, #0x3f20, lsl #16 - 806f0: 97fffe58 bl 80050 - 806f4: 528012c0 mov w0, #0x96 // #150 - 806f8: 97ffffd5 bl 8064c - 806fc: 52980001 mov w1, #0xc000 // #49152 - 80700: 52801300 mov w0, #0x98 // #152 - 80704: 72a7e400 movk w0, #0x3f20, lsl #16 - 80708: 97fffe52 bl 80050 - 8070c: 528012c0 mov w0, #0x96 // #150 - 80710: 97ffffcf bl 8064c - 80714: 52800001 mov w1, #0x0 // #0 - 80718: 52801300 mov w0, #0x98 // #152 - 8071c: 72a7e400 movk w0, #0x3f20, lsl #16 - 80720: 97fffe4c bl 80050 - 80724: 528a0080 mov w0, #0x5004 // #20484 - 80728: 72a7e420 movk w0, #0x3f21, lsl #16 - 8072c: 97fffe53 bl 80078 - 80730: b9001fe0 str w0, [sp, #28] - 80734: b9401fe0 ldr w0, [sp, #28] - 80738: 32000000 orr w0, w0, #0x1 - 8073c: 2a0003e1 mov w1, w0 - 80740: 528a0080 mov w0, #0x5004 // #20484 - 80744: 72a7e420 movk w0, #0x3f21, lsl #16 - 80748: 97fffe42 bl 80050 - 8074c: 52800001 mov w1, #0x0 // #0 - 80750: 528a0c00 mov w0, #0x5060 // #20576 - 80754: 72a7e420 movk w0, #0x3f21, lsl #16 - 80758: 97fffe3e bl 80050 - 8075c: 52800001 mov w1, #0x0 // #0 - 80760: 528a0880 mov w0, #0x5044 // #20548 - 80764: 72a7e420 movk w0, #0x3f21, lsl #16 - 80768: 97fffe3a bl 80050 - 8076c: 52800061 mov w1, #0x3 // #3 - 80770: 528a0980 mov w0, #0x504c // #20556 - 80774: 72a7e420 movk w0, #0x3f21, lsl #16 - 80778: 97fffe36 bl 80050 - 8077c: 52800001 mov w1, #0x0 // #0 - 80780: 528a0a00 mov w0, #0x5050 // #20560 - 80784: 72a7e420 movk w0, #0x3f21, lsl #16 - 80788: 97fffe32 bl 80050 - 8078c: 528021c1 mov w1, #0x10e // #270 - 80790: 528a0d00 mov w0, #0x5068 // #20584 - 80794: 72a7e420 movk w0, #0x3f21, lsl #16 - 80798: 97fffe2e bl 80050 - 8079c: 528000c1 mov w1, #0x6 // #6 - 807a0: 528a0900 mov w0, #0x5048 // #20552 - 807a4: 72a7e420 movk w0, #0x3f21, lsl #16 - 807a8: 97fffe2a bl 80050 - 807ac: 52800061 mov w1, #0x3 // #3 - 807b0: 528a0c00 mov w0, #0x5060 // #20576 - 807b4: 72a7e420 movk w0, #0x3f21, lsl #16 - 807b8: 97fffe26 bl 80050 - 807bc: 94000029 bl 80860 - 807c0: d503201f nop - 807c4: a8c27bfd ldp x29, x30, [sp], #32 - 807c8: d65f03c0 ret - -00000000000807cc : - 807cc: a9be7bfd stp x29, x30, [sp, #-32]! - 807d0: 910003fd mov x29, sp - 807d4: 39007fe0 strb w0, [sp, #31] - 807d8: 14000003 b 807e4 - 807dc: 52800020 mov w0, #0x1 // #1 - 807e0: 97ffff9b bl 8064c - 807e4: 528a0a80 mov w0, #0x5054 // #20564 - 807e8: 72a7e420 movk w0, #0x3f21, lsl #16 - 807ec: 97fffe23 bl 80078 - 807f0: 121b0000 and w0, w0, #0x20 - 807f4: 7100001f cmp w0, #0x0 - 807f8: 54ffff20 b.eq 807dc // b.none - 807fc: 39407fe0 ldrb w0, [sp, #31] - 80800: 2a0003e1 mov w1, w0 - 80804: 528a0800 mov w0, #0x5040 // #20544 - 80808: 72a7e420 movk w0, #0x3f21, lsl #16 - 8080c: 97fffe11 bl 80050 - 80810: d503201f nop - 80814: a8c27bfd ldp x29, x30, [sp], #32 - 80818: d65f03c0 ret - -000000000008081c : - 8081c: a9bf7bfd stp x29, x30, [sp, #-16]! - 80820: 910003fd mov x29, sp - 80824: 14000003 b 80830 - 80828: 52800020 mov w0, #0x1 // #1 - 8082c: 97ffff88 bl 8064c - 80830: 528a0a80 mov w0, #0x5054 // #20564 - 80834: 72a7e420 movk w0, #0x3f21, lsl #16 - 80838: 97fffe10 bl 80078 - 8083c: 12000000 and w0, w0, #0x1 - 80840: 7100001f cmp w0, #0x0 - 80844: 54ffff20 b.eq 80828 // b.none - 80848: 528a0800 mov w0, #0x5040 // #20544 - 8084c: 72a7e420 movk w0, #0x3f21, lsl #16 - 80850: 97fffe0a bl 80078 - 80854: 12001c00 and w0, w0, #0xff - 80858: a8c17bfd ldp x29, x30, [sp], #16 - 8085c: d65f03c0 ret - -0000000000080860 : - 80860: a9bf7bfd stp x29, x30, [sp, #-16]! - 80864: 910003fd mov x29, sp - 80868: 14000004 b 80878 - 8086c: 528a0800 mov w0, #0x5040 // #20544 - 80870: 72a7e420 movk w0, #0x3f21, lsl #16 - 80874: 97fffe01 bl 80078 - 80878: 528a0a80 mov w0, #0x5054 // #20564 - 8087c: 72a7e420 movk w0, #0x3f21, lsl #16 - 80880: 97fffdfe bl 80078 - 80884: 12000000 and w0, w0, #0x1 - 80888: 7100001f cmp w0, #0x0 - 8088c: 54ffff01 b.ne 8086c // b.any - 80890: d503201f nop - 80894: d503201f nop - 80898: a8c17bfd ldp x29, x30, [sp], #16 - 8089c: d65f03c0 ret - -00000000000808a0 : - 808a0: a9bd7bfd stp x29, x30, [sp, #-48]! - 808a4: 910003fd mov x29, sp - 808a8: f9000fe0 str x0, [sp, #24] - 808ac: b9002fff str wzr, [sp, #44] - 808b0: 14000009 b 808d4 - 808b4: b9402fe0 ldr w0, [sp, #44] - 808b8: f9400fe1 ldr x1, [sp, #24] - 808bc: 8b000020 add x0, x1, x0 - 808c0: 39400000 ldrb w0, [x0] - 808c4: 97ffffc2 bl 807cc - 808c8: b9402fe0 ldr w0, [sp, #44] - 808cc: 11000400 add w0, w0, #0x1 - 808d0: b9002fe0 str w0, [sp, #44] - 808d4: b9402fe0 ldr w0, [sp, #44] - 808d8: f9400fe1 ldr x1, [sp, #24] - 808dc: 8b000020 add x0, x1, x0 - 808e0: 39400000 ldrb w0, [x0] - 808e4: 7100001f cmp w0, #0x0 - 808e8: 54fffe61 b.ne 808b4 // b.any - 808ec: d503201f nop - 808f0: d503201f nop - 808f4: a8c37bfd ldp x29, x30, [sp], #48 - 808f8: d65f03c0 ret - -00000000000808fc : - 808fc: a9bd7bfd stp x29, x30, [sp, #-48]! - 80900: 910003fd mov x29, sp - 80904: b9001fe0 str w0, [sp, #28] - 80908: 52800380 mov w0, #0x1c // #28 - 8090c: b9002fe0 str w0, [sp, #44] - 80910: 14000015 b 80964 - 80914: b9402fe0 ldr w0, [sp, #44] - 80918: b9401fe1 ldr w1, [sp, #28] - 8091c: 1ac02420 lsr w0, w1, w0 - 80920: 12000c00 and w0, w0, #0xf - 80924: b9002be0 str w0, [sp, #40] - 80928: b9402be0 ldr w0, [sp, #40] - 8092c: 7100241f cmp w0, #0x9 - 80930: 54000089 b.ls 80940 // b.plast - 80934: b9402be0 ldr w0, [sp, #40] - 80938: 1100dc00 add w0, w0, #0x37 - 8093c: 14000003 b 80948 - 80940: b9402be0 ldr w0, [sp, #40] - 80944: 1100c000 add w0, w0, #0x30 - 80948: b9002be0 str w0, [sp, #40] - 8094c: b9402be0 ldr w0, [sp, #40] - 80950: 12001c00 and w0, w0, #0xff - 80954: 97ffff9e bl 807cc - 80958: b9402fe0 ldr w0, [sp, #44] - 8095c: 51001000 sub w0, w0, #0x4 - 80960: b9002fe0 str w0, [sp, #44] - 80964: b9402fe0 ldr w0, [sp, #44] - 80968: 7100001f cmp w0, #0x0 - 8096c: 54fffd4a b.ge 80914 // b.tcont - 80970: d503201f nop - 80974: d503201f nop - 80978: a8c37bfd ldp x29, x30, [sp], #48 - 8097c: d65f03c0 ret - -0000000000080980 : - 80980: a9be7bfd stp x29, x30, [sp, #-32]! - 80984: 910003fd mov x29, sp - 80988: b9001fe0 str w0, [sp, #28] - 8098c: b9001be1 str w1, [sp, #24] - 80990: b90017e2 str w2, [sp, #20] - 80994: 97ffff3e bl 8068c - 80998: 97ffff1e bl 80610 - 8099c: d503201f nop - 809a0: a8c27bfd ldp x29, x30, [sp], #32 - 809a4: d65f03c0 ret diff --git a/lab1/build/lib/mbox.o b/lab1/build/lib/mbox.o deleted file mode 100644 index b633b026d685a61bd8bbceea1fc9cbd420504b05..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4872 zcmbtYU5p#m6+ScLn|Nc#>$Q{YZWFNs*))XUv3J=53;A&pAlVcp>8eqw_%UO9)*fPy z!*~n{X~|af0p7Aw1VVzq8-%CuM3xE(ia??d?E`9yL|eR4AAlEBsS=8+WqZz@d%d%F zotO4RzW1K*{N8i_W^?huhab{44J2vs9;|W_1&F6s$3;FY!WPKF@`VqsE*r4W9fTW8 zC79L$wv3s^pCS9oEOg)UQT6f|z|&_|R({?cEZ)!>J2Kr;aT=14F#+!A=3#LuUtEMO ztNQ(X0O%R=a|r!FdR2GHARooWG0@KZ<_8fYhW_B%>_LDt-QhQW1Un$JeBtA_KQu~z zS-$YQUcM_A^{XovjjJm=;Rdkz+3rqQEW-S(32*w{y|4&6Vwm5`Nmz{Iyt*gR@4uh_ zeCcyoI9NBYb3O(`U6j*!ED2A4Lpi(v3z{}ROLOn;rCi|h(mlmRK7W8ks?YL;Pk26m zz+%Tx0V~YQp5)_5Q;e(z76$e7U&K#iZxEwDlA^I-e#w~_#9|w{kQ!5eEdCDm%&mg{ zcvSm|P&@Qf;!K>CJ9D5vnIelMb3C-Mxnu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*-Nb=KE9JEdGzG{_jRiDVY3!0JWp-+5i9m diff --git a/lab1/build/lib/shell.o b/lab1/build/lib/shell.o deleted file mode 100644 index 6dd546f123f0bcb5b6c70f5f806389a32ae2b1c9..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 11328 zcmcIqZ)_CD6`#GmfwRvx7#nQ!Ctec*Cc$Te-0&xMxIjW|KnW$#QU&Qa-z~mN&UfbS z987=~nkq^~sz4jHs!9?Xr4fzNDyf>5s3@gXBk`dhn$kx3kX9y*)Oa#H^V|SPqfG16k*Xg0W!8P&WvC6ggEAi_*#@daN}2jy%3N7 z&=EUKJH*?C*f${v2Yd8q+_^q^gZ&4txLt7=w$R5Gi0{NXH}NjVi7{5{D@lDxEB;R> zCtH}~`oUlS__`}j2qBKcAJ)&dd+wjFANK>zK%V&BD(9(N@I~7CUg9 zw?H4*X9)Vd2r*2!&MV@|*DeU*921uhUx@2D#I^DY+QEDV97iD^H}wsp{rY!#Ean<( zuM_*0Uzw-Z_OSF9oeq#*Jy>l6bAjl zc+41X){nNmkx%>aJrl%-+|&50`J)})mr#q0pBu$`w3yA8y>cd7@(}Vy{QMZ{bA>=Z z;OBA$@5_Z^F5Q7zA&UM`p-|=;2z)Q?KbB4TS}jTkO4(m zP@qyZHc+OTU=89G{-IAd7Ssrl1VMh8AEJCAz4g&+hK}I*+O28##`t0jB6Gl zcIF?=7xw49RAFQ!nNKqvtN(BH06h5MAC!oCeAd}L9nx9_hr%B2BaF*Av8oS`n?T*%4$;74~^{=A$P_b08LpnfFwc>!%nD6AJxvu`7qR346mTZ zY^*~wBr0p5*%+2^Yl@jDYpR_A6+WV{I42(ht>vkWHwDH6+7^uA;VI^z6uN&FwnHaI zo0K@9L~1Wam2M9j_~860_sz39l>4D(<*tK%2cQ}X=0P6Dj7S%l=#b(;NFKUDaZWbD zL#JZ=cLv7Sv@IC_9E^j!eMs=!tO%`c!d^lr4h7oZk=6{b2<|mg1iP8w5fNJ3q6x+W z0)1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upSevty>0kn)As)l!auOh diff --git a/lab1/build/lib/uart.o b/lab1/build/lib/uart.o deleted file mode 100644 index f9c9d7a61c63beaec0060e94a350851d83cfb815..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6160 zcmbtXU2Ggz6+Sbw*FRZ%ZSSTKV-t^46I{}rwT;`#t({B~pta*Btw{=%g50%t?Ok=f z>+TPANNFs!Ra@WzOA!>|L_AOtBpxb+ge(zg$~;z&Dl&UeoF?zz8n_sS<{KV@4MD6!y&(6AH=(4A=LzEpiU2npDI34UGgg00;F z*b)E-2VCbj^#OkiBG6Mu>^AE4E`RF;z_a)6?w%(<{V;E1+nN9E&gCC}cgKN^by%N+ zKYXW*)K@7_a;)~mLmd)hp}rc^@NS7yJ35DjeCzQB=QiocZNVFJkZ6V@rs3=Gr8(EE z2Vm^B10U0U)DCnsVr9E+4LePBv^Q)Sf1qLC9K`%i%_crAp7M2m>I046&gGxp(8sTS z1tuIEf0yDhW?gFopf5fE@SKa|U%%o{P#-|6aWCIbf5-! zIfnWk*3%775+~I|HO%bXUBgY>U^q4?ZE~x1NL_o3V=GE*QtXQ@%6^#@Yx5PC+b_#MfEJs>v8tsa^}uPDg;#7I>x;_93il+yF!rDdRXPEkh8E9!F-J9aeE9+qw{)My7TT8m)wF z036Wq>4fHq>UD)URn?(;RK;IE)r)<;AAfQVKu#l%0)W0YLlBjhXjb46)FReDW1V23 zpn*TjOBM19seEyPO$jmO#AnW=&ZI>9IU&yE9}h%WgQEAih)#(IFx7TN zj2JvI91un6bm$=T9IEt+gio^(o9t%P{0DDU6DPS5!R^apB1qaLU^M4h=@*#BO}DuGKo)nQV?sT#giP7LE)15 zkW5CWb=r>Lpr^{EQZ-eoERKzgji(Cfg;A&#EBWPOHsjJpfAs7H_w?vP?u0k)jkw8` zLcUrpWRuxqCZ8^%onFXK6;>Y{cazI*@*GAi6-&uVHNE(3a4om1M2>e7=}TR?`cGYz3V`_+lYl$*H7#sVL`pK3~jNgC&sSd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Wzil4B8=OxjElHKH y#+7O}+oqI1wbK*#H9P4p)GVLE%)Li>!@U1XWN2cJ71h-&KgX9ZRllMz^Zx_VyRy{) diff --git a/lab1/kernel8.elf b/lab1/kernel8.elf deleted file mode 100755 index ce149d7dc8139a11b75c9d5bbd466e35b792ea2c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 80384 zcmeI3dvIJ=eaFwech729kJVa|CHWEiN_G+%M=RNJh#e$*ZRg<^vExSwU|6rDwY6lm zQdTQsW2Y7*ou(yBBbotbP@IsV#XP3tPD2|(pbnIlVVG%X%A;*cNfC(@GCcp%k025#WOn?b60Vco%m;e)C0!)AjFaajO1egF5U;<2l z2`~XBzyz286JP>NfC(@GCcp%k025#WOn?b60Vco%m;e)C0!)AjFaajO1egF5U;<2l z2`~XBzyz286JP>NfC(@GCcp%k025#WOn?b60Vco%m;e)C0!)AjFaajO1egF5U;<2l z2`~XBzyz286JP>NfC(@GCcp%k025#WOn?b60Vco%m;e)C0!)AjFaajO1egF5U;<2l z2`~XBzyz286JP>NfC(@GCcp%k025#WOn?b60Vco%m;e)C0!)AjFaajO1egF5U;<2l z2`~XBzyz286JP>NfC(@GCcp%k025#WOn?b60Vco%m;e)C0!)AjFaajO1egF5U;<2l z2`~XBzyz286JP>NfC(@GCcp%k025#WOn?b60Vco%m;e)C0!)AjFaajO1egF5U;<2l z2`~XBzyz286JP>NfC(@GCcp%k025#WOn?b60Vco%n85#?z-Pqf?{`GfAI}Q$e8%^_ zU#V2uvW|FQn-EiUeoct>j|j18+hgL*9T9QgbCt?%hg|X0FJUK=)NV{S?(1`9r}*A% zqnNo=CuU|F(=(Sm@rBvC^o%dW%xa3iQ%qg-GC#0(WFtg+#>%gr{@UlSdSVJOE?>%s zEv^tPgjKu zr+!>L{ncu|m9y^WD`&mWSJsHjLQWo>T_a}FV)CFbo-NI;7c;_z4Ea^|iy6>rnca`L zzxa(;F1;eAwhj9)sCq;!nT4LptLw!>KcO5R6;qBgd2j~#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Hkk1y( z^Kpq5^I75ORzt^es7Tqa)N(SQ(c zpM+eK-#cf|RsF013VTt10sj+NPg2LIf)7!-Jof~jp95x?*FZYQV(3*bI((`Z9IiK9 zTtUf2c`k>eka2lF{=1*}9CB<7*f=@e&&eK>Jcg?$#-E4r{|9WGom0WX=W_;UpU`K} z739U3eEwiFQ7_LEoTE;^ji23`8~vK}s}DK7JdxMevm{VBQ;R7gC;HD1?aO!XQVUu&hT7E090& z$3BZ-BpTHijrL2K$NoGFtr7s@4^H?L{LwF}CBKw80InKoq)fB`HHUJ%L?b&jY7^xaxscsuL_1ycHwM6009@zd0iYN3RWI4Dp{?I=~%6`SPOGZ$G0wA zRYDFF(7(Sd*RocVd&d}CooMQA77=VwPivw>u0|{uwfhtc(bkT(j>O&$u`AKu-qg|T z(5at#U}U@+A>Y2aMtM<4ez`0IR`jcFS2Mw?8NvD)_`wL%THF=DdCvG+;Cxl!UXQyB zy7LUIno)al%22_}KmH&sSRcnd4E<51-*mEYXzEU_p9Sm)?y}!(8{b{nU$nrJ@%M2L z17EB0jlh`?-xJzGw9|acv zZrg0f`LO?fmwpBG0sL?!l>UMEjapyt^55k0?}xq?{>xnc>$RTO{SNf?(64am8NUEL z4%}3@*r4n21@J+}F*^BrHYmahK)(RL@TYBW(tf<2h%28We4)Puy{@xd&qkMiA@qSe z`M6TA>DB&2Uk!bu;+Ols)#V?Dz8U&ME`8LcKLY(V=ylJ@de>_`yU0sF503c27z{|L e*QdsSmW3WW3lv_hWpjdky_R?A@u;?M(egjgo#k}^ diff --git a/lab1/lib/include/reset.h b/lab1/lib/include/reset.h new file mode 100644 index 000000000..b12aa1945 --- /dev/null +++ b/lab1/lib/include/reset.h @@ -0,0 +1,19 @@ +#ifndef __RESET_H__ +#define __RESET_H__ + +#include "mmio.h" +#define PM_PASSWORD 0x5a000000 +#define PM_RSTC 0x3F10001c +#define PM_WDOG 0x3F100024 + +void reset(int tick) { // reboot after watchdog timer expire + mmio_write(PM_RSTC, PM_PASSWORD | 0x20); // full reset + mmio_write(PM_WDOG, PM_PASSWORD | tick); // number of watchdog tick +} + +void cancel_reset() { + mmio_write(PM_RSTC, PM_PASSWORD | 0); // full reset + mmio_write(PM_WDOG, PM_PASSWORD | 0); // number of watchdog tick +} + +#endif \ No newline at end of file diff --git a/lab1/lib/include/shell.h b/lab1/lib/include/shell.h index 4edadbc20..88ae05f88 100644 --- a/lab1/lib/include/shell.h +++ b/lab1/lib/include/shell.h @@ -2,6 +2,7 @@ #define __SHELL_H__ #include "mbox.h" #include "stdint.h" +#include "reset.h" #include "string.h" // #include "uart.h" @@ -18,15 +19,14 @@ void exec_cmd(); void cmd_help(); void cmd_hello(); -//void cmd_reboot(); +void cmd_reboot(); void cmd_sysinfo(); void cmd_unknown(); struct func func_list[] = { {.name = "help", .ptr = cmd_help, .desc = "print this help menu"}, {.name = "hello", .ptr = cmd_hello, .desc = "print Hello World!"}, - {.name = "reboot", .ptr = cmd_help, .desc = "reboot the device"}, - {.name = "sysinfo", .ptr = cmd_sysinfo, .desc = "get system info"}, - {.name = "123", .ptr = cmd_hello, .desc = "???"}}; + {.name = "reboot", .ptr = cmd_reboot, .desc = "reboot the device"}, + {.name = "sysinfo", .ptr = cmd_sysinfo, .desc = "get system info"}}; #endif \ No newline at end of file diff --git a/lab1/lib/shell.c b/lab1/lib/shell.c index fac49825f..236954b22 100644 --- a/lab1/lib/shell.c +++ b/lab1/lib/shell.c @@ -11,9 +11,6 @@ void welcome_msg() { " | | | | \\___ \\ | | / / | | | | / / |__ _|" ENDL " | |__| | ____) || |____ / /_ | |_| | / /_ | | "ENDL " \\____/ |_____/ \\_____| |____| \\___/ |____| |_|" ENDL); - - - } void read_cmd() { @@ -63,10 +60,6 @@ void cmd_help() { void cmd_hello() { uart_write_string("Hello World!" ENDL); - uart_write_string(func_list[0].name); - uart_write_string(func_list[1].name); - uart_write_string(func_list[2].name); - uart_write_string(func_list[3].desc); } @@ -83,6 +76,7 @@ void cmd_sysinfo() { uart_puth(*board_revision); uart_write_string(ENDL); + // Memory Info get_memory_info(mem_base, mem_size); uart_write_string("Memroy Base Address : 0x"); @@ -94,6 +88,11 @@ void cmd_sysinfo() { uart_write_string(ENDL); } +void cmd_reboot() { + uart_write_string("Rebooting...."ENDL); + reset(10); +} + void cmd_unknown() { uart_write_string("Unknown command: "); uart_write_string(buf); diff --git a/lab1/lib/uart.c b/lab1/lib/uart.c index d8012962e..490fc53d9 100644 --- a/lab1/lib/uart.c +++ b/lab1/lib/uart.c @@ -7,17 +7,17 @@ void uart_init() { uint32_t t; /* Init GPIO */ - // mini UART -> set ALT5, PL011 UART -> set ALT0 + // mini UART -> set ALT5 // Configure GPFSELn register to change alternate function t = mmio_read(GPFSEL1); t &= ~(7 << 12); // clean gpio14 - t |= (2 << 12); // set alt5 + t |= (2 << 12); // set alt5 ,decimal(2) = binary(101) t &= ~(7 << 15); // clean gpio15 - t |= (2 << 15); // set alt5 + t |= (2 << 15); // set alt5 ,2 = 101 mmio_write(GPFSEL1, t); /* Configure pull up/down register to disable GPIO pull up/down */ - /* + /* P.101 The GPIO Pull-up/down Clock Registers control the actuation of internal pull-downs on the respective GPIO pins. These registers must be used in conjunction with the GPPUD register to effect GPIO Pull-up/down changes. The following sequence of events is @@ -66,7 +66,7 @@ void uart_init() { mmio_write(AUX_MU_CNTL_REG, 3); // clear rx data - uart_flush(); + //uart_flush(); } void uart_write(char c) { From a9c8c045cf96f49161978194b7f10a97d8dfe25d Mon Sep 17 00:00:00 2001 From: root Date: Tue, 12 Mar 2024 14:09:33 +0800 Subject: [PATCH 08/10] Add malloc --- lab2/1.cpp | 0 lab2/Makefile | 141 ++++++++++++++++++++++++++++++++++++++ lab2/boot.S | 30 ++++++++ lab2/boot.o | Bin 0 -> 1216 bytes lab2/lib/include/aux.h | 33 +++++++++ lab2/lib/include/gpio.h | 35 ++++++++++ lab2/lib/include/mbox.h | 111 ++++++++++++++++++++++++++++++ lab2/lib/include/mmio.h | 14 ++++ lab2/lib/include/reset.h | 19 +++++ lab2/lib/include/shell.h | 32 +++++++++ lab2/lib/include/stdint.h | 13 ++++ lab2/lib/include/string.h | 20 ++++++ lab2/lib/include/uart.h | 19 +++++ lab2/lib/mbox.c | 98 ++++++++++++++++++++++++++ lab2/lib/mmio.c | 11 +++ lab2/lib/shell.c | 113 ++++++++++++++++++++++++++++++ lab2/lib/uart.c | 102 +++++++++++++++++++++++++++ lab2/linker.ld | 48 +++++++++++++ lab2/main.c | 10 +++ lab2/main.o | Bin 0 -> 1656 bytes 20 files changed, 849 insertions(+) create mode 100644 lab2/1.cpp create mode 100644 lab2/Makefile create mode 100644 lab2/boot.S create mode 100644 lab2/boot.o create mode 100644 lab2/lib/include/aux.h create mode 100644 lab2/lib/include/gpio.h create mode 100644 lab2/lib/include/mbox.h create mode 100644 lab2/lib/include/mmio.h create mode 100644 lab2/lib/include/reset.h create mode 100644 lab2/lib/include/shell.h create mode 100644 lab2/lib/include/stdint.h create mode 100644 lab2/lib/include/string.h create mode 100644 lab2/lib/include/uart.h create mode 100644 lab2/lib/mbox.c create mode 100644 lab2/lib/mmio.c create mode 100644 lab2/lib/shell.c create mode 100644 lab2/lib/uart.c create mode 100644 lab2/linker.ld create mode 100644 lab2/main.c create mode 100644 lab2/main.o diff --git a/lab2/1.cpp b/lab2/1.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/lab2/Makefile b/lab2/Makefile new file mode 100644 index 000000000..3fe0d0de7 --- /dev/null +++ b/lab2/Makefile @@ -0,0 +1,141 @@ +BUILD_DIR = ./build +# Lib +LIB_SRC_DIR = ./lib + +# LIB_SRC = \ +# $(LIB_SRC_DIR)/mbox.c \ +# $(LIB_SRC_DIR)/mmio.c \ +# $(LIB_SRC_DIR)/shell.c \ +# $(LIB_SRC_DIR)/string.c \ +# $(LIB_SRC_DIR)/uart.c \ +# $(LIB_SRC_DIR)/utils.c \ + +LIB_SRC = \ + $(LIB_SRC_DIR)/mmio.c \ + $(LIB_SRC_DIR)/mbox.c \ + $(LIB_SRC_DIR)/shell.c \ + $(LIB_SRC_DIR)/uart.c \ + +LIB_INCLUDES = \ + -I $(LIB_SRC_DIR)/include \ + +LIB_BUILD_DIR = $(BUILD_DIR)/lib +LIB_OBJS := $(patsubst %.c,$(LIB_BUILD_DIR)/%.o,$(notdir $(LIB_SRC))) + +# Application +APP_SRC_DIR = . + +APP_SRC = \ + $(APP_SRC_DIR)/main.c \ + +APP_ASM = \ + $(APP_SRC_DIR)/boot.S \ + +APP_INCLUDES = \ + -I ./ \ + $(LIB_INCLUDES) \ + +APP_BUILD_DIR = $(BUILD_DIR)/app +APP_OBJS := $(patsubst %.c,$(APP_BUILD_DIR)/%.o,$(notdir $(APP_SRC))) +APP_OBJS += $(patsubst %.S,$(APP_BUILD_DIR)/%.o,$(notdir $(APP_ASM))) + +VPATH += \ + $(LIB_SRC_DIR) \ + $(APP_SRC_DIR) \ + +# ARM toolchain +CROSS = aarch64-linux-gnu +CC = $(CROSS)-gcc +AS = $(CROSS)-as +LD = $(CROSS)-ld +OC = $(CROSS)-objcopy +OD = $(CROSS)-objdump +SP = $(CROSS)-strip + +# Project +OUT_OBJS = \ + $(LIB_OBJS) \ + $(APP_OBJS) \ + +BUILD_DIRECTORIES = \ + $(LIB_BUILD_DIR) \ + $(APP_BUILD_DIR) \ + +PROJ = kernel8 +OUT_ELF = ./$(PROJ).elf +OUT_IMG = ./$(PROJ).img +LINKER_FILE = linker.ld + +CCFLAGS = -Wall -O0 -fno-stack-protector +LDFLAGS = -T$(LINKER_FILE) -nostdlib + +.PHONY: clean directories out_elf run docker_cp +all: directories $(OUT_OBJS) $(OUT_ELF) $(OUT_IMG) +directories: $(BUILD_DIRECTORIES) +out_elf: directories $(OUT_ELF) +out_img: directories $(OUT_IMG) + +# Compile Object Files --------------------------------------------------------- +$(APP_BUILD_DIR)/%.o : %.c + @echo '============================================================' + @echo ' Building target: $@' + @echo '============================================================' + @echo "[+] Building: $<" + $(CC) $(CCFLAGS) $(APP_INCLUDES) -g -o $@ -c $< + @echo "[+] Finished Building: $<" + @echo '' + +$(APP_BUILD_DIR)/%.o : %.S + @echo '============================================================' + @echo ' Building target: $@' + @echo '============================================================' + @echo "[+] Building: $<" + $(CC) $(ASMFLAGS) $(APP_INCLUDES) -g -o $@ -c $< + @echo "[+] Finished Building: $<" + @echo '' + +$(LIB_BUILD_DIR)/%.o : %.c + @echo '============================================================' + @echo ' Building target: $@' + @echo '============================================================' + @echo "[+] Building: $<" + $(CC) $(CCFLAGS) $(LIB_INCLUDES) -g -o $@ -c $< + @echo "[+] Finished Building: $<" + @echo '' + +# Generate ELF ----------------------------------------------------------------- +$(OUT_ELF): $(OUT_OBJS) + @echo '============================================================' + @echo ' Building target: $@' + @echo '============================================================' + $(LD) $(LDFLAGS) -o $@ $(OUT_OBJS) + $(OD) -d $@ > $(BUILD_DIR)/$(PROJ).objdump + # $(SP) $@ + @echo '[+] Finished building target: $@' + @echo ' ' + +# Generate IMG ----------------------------------------------------------------- +$(OUT_IMG): $(OUT_ELF) + @echo '============================================================' + @echo ' Building target: $@' + @echo '============================================================' + $(OC) -O binary $(OUT_ELF) $@ + @echo '[+] Finished building target: $@' + @echo ' ' + +$(BUILD_DIRECTORIES): + mkdir -p $@ + +run: + qemu-system-aarch64 -M raspi3 -kernel kernel8.img -display none -serial null -serial stdio + +debug: + qemu-system-aarch64 -M raspi3b -kernel kernel8.img -display none -serial null -serial stdio -s -S + +docker_cp: + docker cp kernel8.elf my_kali:/ + +clean: + rm -rf *.elf + rm -rf *.img + rm -rf $(BUILD_DIR) \ No newline at end of file diff --git a/lab2/boot.S b/lab2/boot.S new file mode 100644 index 000000000..633875f8a --- /dev/null +++ b/lab2/boot.S @@ -0,0 +1,30 @@ +.section ".text.boot" + +.global _start + +_start: + // read cpu id, stop slave cores + mrs x1, mpidr_el1 + and x1, x1, #3 + cbz x1, 2f + // cpu id > 0, stop +1: wfe + b 1b +2: // cpu id == 0 + + // set top of stack just before our code (stack grows to a lower address per AAPCS64) + ldr x1, =_start + mov sp, x1 + + // clear bss + ldr x1, =__bss_start + ldr w2, =__bss_size +3: cbz w2, 4f + str xzr, [x1], #8 + sub w2, w2, #1 + cbnz w2, 3b + + // jump to C code, should not return +4: bl kernel_main + // for failsafe, halt this core too + b 1b \ No newline at end of file diff --git a/lab2/boot.o b/lab2/boot.o new file mode 100644 index 0000000000000000000000000000000000000000..605353a83c440cb605a6b38d1e2913ac4a3fbe8c GIT binary patch literal 1216 zcmbW0&q~8U5XQeWL0k2pc(72A77Bt$K&aqB=prZ{Jm}3^+|q!>{(&Ti>O~PBK*bl( zC-5NnB)yC8Ab5*2?XF$6DM$yx%=~t~>1;E(IXFJdIS#Zr_`o>R6u8ZeV=)W`3drLH zyMu}+o+R)dl-)s^rfbr{Ssi#}{{g|U(z!H}3eq$jzJ#aA6E* zv~uYr%UpO9cy#AUJ|Z6WEQRL6;!Bh-XY`*Ra;uoq)hT>^3P-h%Y7;@wh~pqmWR&Q* zbsgd|jJjbv=*U)A{Zvi)5?ydn#q9Kba>N%5E>z4bkvI5}!3ze5A76D6*&v@pBY&Zz zB6UmFtviO{-AC%-$4X78$Xv-=H)8 zpJvr>la_l}0eX2pv73BV0r}ag}xh(7Jc~IwN)ra?&wYHvj d!M;07-;{2X6T=k#BP$eT>4h3f@2M8p`d^tlLjwQ+ literal 0 HcmV?d00001 diff --git a/lab2/lib/include/aux.h b/lab2/lib/include/aux.h new file mode 100644 index 000000000..7fca3f1ec --- /dev/null +++ b/lab2/lib/include/aux.h @@ -0,0 +1,33 @@ +#ifndef __AUX_H__ +#define __AUX_H__ + +#include "mmio.h" +/* Ref: https://cs140e.sergio.bz/docs/BCM2837-ARM-Peripherals.pdf + * Page: 8 +*/ +#define AUX_BASE (MMIO_BASE + 0x00215000) +#define AUX_IRQ (AUX_BASE + 0x0) +#define AUX_ENABLES (AUX_BASE + 0x4) +#define AUX_MU_IO_REG (AUX_BASE + 0x40) +#define AUX_MU_IER_REG (AUX_BASE + 0x44) +#define AUX_MU_IIR_REG (AUX_BASE + 0x48) +#define AUX_MU_LCR_REG (AUX_BASE + 0x4c) +#define AUX_MU_MCR_REG (AUX_BASE + 0x50) +#define AUX_MU_LSR_REG (AUX_BASE + 0x54) +#define AUX_MU_MSR_REG (AUX_BASE + 0x58) +#define AUX_MU_SCRATCH (AUX_BASE + 0x5c) +#define AUX_MU_CNTL_REG (AUX_BASE + 0x60) +#define AUX_MU_STAT_REG (AUX_BASE + 0x64) +#define AUX_MU_BAUD_REG (AUX_BASE + 0x68) +#define AUX_SPI0_CNTL0_REG (AUX_BASE + 0x80) +#define AUX_SPI0_CNTL1_REG (AUX_BASE + 0x84) +#define AUX_SPI0_STAT_REG (AUX_BASE + 0x88) +#define AUX_SPI0_IO_REG (AUX_BASE + 0x90) +#define AUX_SPI0_PEEK_REG (AUX_BASE + 0x94) +#define AUX_SPI1_CNTL0_REG (AUX_BASE + 0xc0) +#define AUX_SPI1_CNTL1_REG (AUX_BASE + 0xc4) +#define AUX_SPI1_STAT_REG (AUX_BASE + 0xc8) +#define AUX_SPI1_IO_REG (AUX_BASE + 0xd0) +#define AUX_SPI1_PEEK_REG (AUX_BASE + 0xd4) + +#endif \ No newline at end of file diff --git a/lab2/lib/include/gpio.h b/lab2/lib/include/gpio.h new file mode 100644 index 000000000..b4322f8db --- /dev/null +++ b/lab2/lib/include/gpio.h @@ -0,0 +1,35 @@ +#ifndef __GPIO_H__ +#define __GPIO_H__ + +#define GPIO_BASE 0x3f200000 +#define GPFSEL0 (GPIO_BASE + 0x0) +#define GPFSEL1 (GPIO_BASE + 0x4) +#define GPFSEL2 (GPIO_BASE + 0x8) +#define GPFSEL3 (GPIO_BASE + 0xc) +#define GPFSEL4 (GPIO_BASE + 0x10) +#define GPFSEL5 (GPIO_BASE + 0x14) +#define GPSET0 (GPIO_BASE + 0x1c) +#define GPSET1 (GPIO_BASE + 0x20) +#define GPCLR0 (GPIO_BASE + 0x28) +#define GPCLR1 (GPIO_BASE + 0x2c) +#define GPLEV0 (GPIO_BASE + 0x34) +#define GPLEV1 (GPIO_BASE + 0x38) +#define GPEDS0 (GPIO_BASE + 0x40) +#define GPEDS1 (GPIO_BASE + 0x44) +#define GPREN0 (GPIO_BASE + 0x4c) +#define GPREN1 (GPIO_BASE + 0x50) +#define GPFEN0 (GPIO_BASE + 0x58) +#define GPFEN1 (GPIO_BASE + 0x5c) +#define GPHEN0 (GPIO_BASE + 0x64) +#define GPHEN1 (GPIO_BASE + 0x68) +#define GPLEN0 (GPIO_BASE + 0x70) +#define GPLEN1 (GPIO_BASE + 0x74) +#define GPAREN0 (GPIO_BASE + 0x7c) +#define GPAREN1 (GPIO_BASE + 0x80) +#define GPAFEN0 (GPIO_BASE + 0x88) +#define GPAFEN1 (GPIO_BASE + 0x8c) +#define GPPUD (GPIO_BASE + 0x94) +#define GPPUDCLK0 (GPIO_BASE + 0x98) +#define GPPUDCLK1 (GPIO_BASE + 0x9c) + +#endif \ No newline at end of file diff --git a/lab2/lib/include/mbox.h b/lab2/lib/include/mbox.h new file mode 100644 index 000000000..8dc9ed9fc --- /dev/null +++ b/lab2/lib/include/mbox.h @@ -0,0 +1,111 @@ +#ifndef __MBOX_H__ +#define __MBOX_H__ + +#include "mmio.h" + +#define VIDEOCORE_MBOX_BASE (MMIO_BASE + 0x0000B880) +#define MBOX_READ (VIDEOCORE_MBOX_BASE + 0x00) +#define MBOX_POLL (VIDEOCORE_MBOX_BASE + 0x10) +#define MBOX_SENDER (VIDEOCORE_MBOX_BASE + 0x14) +#define MBOX_STATUS (VIDEOCORE_MBOX_BASE + 0x18) +#define MBOX_CONFIG (VIDEOCORE_MBOX_BASE + 0x1C) +#define MBOX_WRITE (VIDEOCORE_MBOX_BASE + 0x20) +#define MBOX_RESPONSE (0x80000000) +#define MBOX_FULL (0x80000000) +#define MBOX_EMPTY (0x40000000) + +#define MBOX_CH_POWER (0) +#define MBOX_CH_FB (1) +#define MBOX_CH_VUART (2) +#define MBOX_CH_VCHIQ (3) +#define MBOX_CH_LEDS (4) +#define MBOX_CH_BTNS (5) +#define MBOX_CH_TOUCH (6) +#define MBOX_CH_COUNT (7) +#define MBOX_CH_PROP (8) + +#define MAIL_BODY_BUF_LEN (4) +#define MAIL_BUF_SIZE (MAIL_BODY_BUF_LEN << 2) +#define MAIL_PACKET_SIZE (MAIL_BUF_SIZE + 24) + +#define REQUEST_CODE 0x00000000 +#define REQUEST_SUCCEED 0x80000000 +#define REQUEST_FAILED 0x80000001 +#define TAG_REQUEST_CODE 0x00000000 +#define END_TAG 0x00000000 + +/* Tags */ +#define GET_FIRMWARE_REVISION 0x00000001 +#define GET_BOARD_MODEL 0x00010001 +#define GET_BOARD_REVISION 0x00010002 +#define GET_BOARD_MAC_ADDR 0x00010003 +#define GET_BOARD_SERIAL 0x00010004 +#define GET_ARM_MEMORY 0x00010005 +#define GET_VC_MEMORY 0x00010006 +#define GET_CLOCKS 0x00010007 + +#define GET_COMMAND_LINE 0x00050001 + +#define GET_DMA_CHANNELS 0x00060001 + +#define GET_POWER_STATE 0x00020001 +#define GET_TIMING 0x00020002 +#define SET_POWER_STATE 0x00028001 + +// and so on... + +/* Unique Device ID */ +#define DEVICE_ID_SD_CARD 0x00000000 +#define DEVICE_ID_UART0 0x00000001 +#define DEVICE_ID_UART1 0x00000002 +#define DEVICE_ID_USB_HCD 0x00000003 +#define DEVICE_ID_I2C0 0x00000004 +#define DEVICE_ID_I2C1 0x00000005 +#define DEVICE_ID_I2C2 0x00000006 +#define DEVICE_ID_SPI 0x00000007 +#define DEVICE_ID_CCP2TX 0x00000008 +#define DEVICE_ID_UNKNOWN 0x00000009 +#define DEVICE_ID_UNKNOWN 0x0000000a + +/* Unique Clock ID */ +#define CLOCK_ID_RESERVED 0x000000000 +#define CLOCK_ID_EMMC 0x000000001 +#define CLOCK_ID_UART 0x000000002 +#define CLOCK_ID_ARM 0x000000003 +#define CLOCK_ID_CORE 0x000000004 +#define CLOCK_ID_V3D 0x000000005 +#define CLOCK_ID_H264 0x000000006 +#define CLOCK_ID_ISP 0x000000007 +#define CLOCK_ID_SDRAM 0x000000008 +#define CLOCK_ID_PIXEL 0x000000009 +#define CLOCK_ID_PWM 0x00000000a +#define CLOCK_ID_HEVC 0x00000000b +#define CLOCK_ID_EMMC2 0x00000000c +#define CLOCK_ID_M2MC 0x00000000d +#define CLOCK_ID_PIXEL_BVB 0x00000000e + +struct mail_header { + uint32_t packet_size; + uint32_t code; +}; + +struct mail_body { + uint32_t id; + uint32_t buf_size; + uint32_t code; + uint32_t buf[MAIL_BODY_BUF_LEN]; + uint32_t end; +}; + +typedef struct mail_t { + struct mail_header header; + struct mail_body body; +} mail_t __attribute__((aligned(16))); + +int mbox_call(mail_t* mbox, uint8_t ch); +void get_board_revision(uint32_t* board_revision); +void get_memory_info(uint32_t* mem_base, uint32_t* mem_size); +void get_board_serial(uint32_t* msb, uint32_t* lsb); + + +#endif \ No newline at end of file diff --git a/lab2/lib/include/mmio.h b/lab2/lib/include/mmio.h new file mode 100644 index 000000000..efbccf3c9 --- /dev/null +++ b/lab2/lib/include/mmio.h @@ -0,0 +1,14 @@ +#ifndef __MMIO_H__ +#define __MMIO_H__ +// #include +#include "stdint.h" + +#define PHY_BASE 0x3F000000 +#define BUS_BASE 0x7f000000 + +#define MMIO_BASE PHY_BASE + +void mmio_write(uint32_t reg, uint32_t data); // MMIO write +uint32_t mmio_read(uint32_t reg); // MMIO read + +#endif \ No newline at end of file diff --git a/lab2/lib/include/reset.h b/lab2/lib/include/reset.h new file mode 100644 index 000000000..b12aa1945 --- /dev/null +++ b/lab2/lib/include/reset.h @@ -0,0 +1,19 @@ +#ifndef __RESET_H__ +#define __RESET_H__ + +#include "mmio.h" +#define PM_PASSWORD 0x5a000000 +#define PM_RSTC 0x3F10001c +#define PM_WDOG 0x3F100024 + +void reset(int tick) { // reboot after watchdog timer expire + mmio_write(PM_RSTC, PM_PASSWORD | 0x20); // full reset + mmio_write(PM_WDOG, PM_PASSWORD | tick); // number of watchdog tick +} + +void cancel_reset() { + mmio_write(PM_RSTC, PM_PASSWORD | 0); // full reset + mmio_write(PM_WDOG, PM_PASSWORD | 0); // number of watchdog tick +} + +#endif \ No newline at end of file diff --git a/lab2/lib/include/shell.h b/lab2/lib/include/shell.h new file mode 100644 index 000000000..88ae05f88 --- /dev/null +++ b/lab2/lib/include/shell.h @@ -0,0 +1,32 @@ +#ifndef __SHELL_H__ +#define __SHELL_H__ +#include "mbox.h" +#include "stdint.h" +#include "reset.h" +#include "string.h" +// #include "uart.h" + +struct func { + char *name; + void (*ptr)(); + char *desc; +}; + +void welcome_msg(); +void shell(); +void read_cmd(); +void exec_cmd(); + +void cmd_help(); +void cmd_hello(); +void cmd_reboot(); +void cmd_sysinfo(); +void cmd_unknown(); + +struct func func_list[] = { + {.name = "help", .ptr = cmd_help, .desc = "print this help menu"}, + {.name = "hello", .ptr = cmd_hello, .desc = "print Hello World!"}, + {.name = "reboot", .ptr = cmd_reboot, .desc = "reboot the device"}, + {.name = "sysinfo", .ptr = cmd_sysinfo, .desc = "get system info"}}; + +#endif \ No newline at end of file diff --git a/lab2/lib/include/stdint.h b/lab2/lib/include/stdint.h new file mode 100644 index 000000000..4b76cee21 --- /dev/null +++ b/lab2/lib/include/stdint.h @@ -0,0 +1,13 @@ +#ifndef __STDINT_H__ +#define __STDINT_H__ + +#define int8_t signed char +#define int16_t signed short int +#define int32_t signed int +#define int64_t signed long int +#define uint8_t unsigned char +#define uint16_t unsigned short int +#define uint32_t unsigned int +#define uint64_t unsigned long int + +#endif \ No newline at end of file diff --git a/lab2/lib/include/string.h b/lab2/lib/include/string.h new file mode 100644 index 000000000..fde569986 --- /dev/null +++ b/lab2/lib/include/string.h @@ -0,0 +1,20 @@ +#ifndef __STRING_H__ +#define __STRING_H__ + +#include "stdint.h" + +#define ENDL "\r\n" + +int strcmp(const char *a, const char *b) { + uint32_t i = 0; + while (a[i] == b[i] && a[i] != '\0' && b[i] != '\0') i++; + return a[i] - b[i]; +} + +uint32_t strlen(const char *a) { + for (uint32_t i = 0;; i++) + if (a[i] == '\0') return i; + return 0; +} + +#endif \ No newline at end of file diff --git a/lab2/lib/include/uart.h b/lab2/lib/include/uart.h new file mode 100644 index 000000000..a5e3b59c0 --- /dev/null +++ b/lab2/lib/include/uart.h @@ -0,0 +1,19 @@ +#ifndef __UART_H__ +#define __UART_H__ + +#include "aux.h" +#include "gpio.h" +#include "mmio.h" + +void uart_init(); +void uart_write(char c); +char uart_read(); +void uart_flush(); +void uart_write_string(char* str); +void uart_puth(uint32_t d); +void delay(uint32_t t) { + for (uint32_t i = 0; i < t; i++) + asm volatile("nop"); +} + +#endif \ No newline at end of file diff --git a/lab2/lib/mbox.c b/lab2/lib/mbox.c new file mode 100644 index 000000000..0b63e94db --- /dev/null +++ b/lab2/lib/mbox.c @@ -0,0 +1,98 @@ +#include "mbox.h" + +int mbox_call(mail_t* mbox, uint8_t ch) { + uint32_t addr_channel; + + // 1. Combine the message address (upper 28 bits) with channel number (lower 4 bits) + addr_channel = (((uint32_t)(uint64_t)mbox) & 0xFFFFFFF0) | (ch & 0xF); + + // 2. Read the status register until the empty flag is not set, then break while + while (mmio_read(MBOX_STATUS) & MBOX_FULL) asm volatile("nop"); + + // 3. If not, then you can write to Mailbox 1 Read/Write register. + mmio_write(MBOX_WRITE, addr_channel); + + // 4. Check if Mailbox 0 status register’s empty flag is set. + // 5. Read from Mailbox 0 Read/Write register. + do { + while (mmio_read(MBOX_STATUS) & MBOX_EMPTY) asm volatile("nop"); + } while (mmio_read(MBOX_READ) != addr_channel); + + + // 6. And check if the value is the same as you wrote in step 1. + // 0x80000000: request successfu + return mbox->header.code == MBOX_RESPONSE; +} + +void get_board_revision(uint32_t* board_revision) { + // Create a mailbox structure and initialize its fields + mail_t mbox = { + .header.packet_size = MAIL_PACKET_SIZE, // Set the packet size in the header + .header.code = REQUEST_CODE, // Set the code in the header to indicate a request + .body.id = GET_BOARD_REVISION, // Set the ID of the body to get board revision + .body.buf_size = MAIL_BUF_SIZE, // Set the size of the buffer in the body + .body.code = TAG_REQUEST_CODE, // Set the code in the body to indicate a tag request + .body.end = END_TAG, // Set the end tag in the body + }; + + // Initialize the buffer in the body to 0 + for (uint32_t i = 0; i < MAIL_BODY_BUF_LEN; i++) { + mbox.body.buf[i] = 0; + } + + // Call the mailbox function to send the request and receive the response + // MBOX_CH_PROP means chennel 8 + mbox_call(&mbox, MBOX_CH_PROP); + + // Extract the board revision information from the response buffer and assign it to board_revision + *board_revision = mbox.body.buf[0]; +} + + +// Get ARM memory Response:Length: 8 +void get_memory_info(uint32_t* mem_base, uint32_t* mem_size) { + mail_t mbox = { + .header.packet_size = MAIL_PACKET_SIZE, + .header.code = REQUEST_CODE, + .body.id = GET_ARM_MEMORY, + .body.buf_size = MAIL_BUF_SIZE, + .body.code = TAG_REQUEST_CODE, + .body.end = END_TAG, + }; + + for (uint32_t i = 0; i < MAIL_BODY_BUF_LEN; i++) mbox.body.buf[i] = 0; + + if (mbox_call(&mbox, MBOX_CH_PROP)) { + *mem_base = mbox.body.buf[0]; // u32: base address in bytes + *mem_size = mbox.body.buf[1]; // u32: size in bytes + + } else { + *mem_size = 0xFFFFFFFF; + *mem_base = 0xFFFFFFFF; + } +} + + +// Get board serial : Response:Length: 8 u64: board serial +void get_board_serial(uint32_t* msb, uint32_t* lsb) { + mail_t mbox = { + .header.packet_size = MAIL_PACKET_SIZE, + .header.code = REQUEST_CODE, + .body.id = GET_BOARD_SERIAL, + .body.buf_size = MAIL_BUF_SIZE, + .body.code = TAG_REQUEST_CODE, + .body.end = END_TAG, + }; + + for (uint32_t i = 0; i < MAIL_BODY_BUF_LEN; i++) mbox.body.buf[i] = 0; + + if (mbox_call(&mbox, MBOX_CH_PROP)) { + *msb = mbox.body.buf[1]; + *lsb = mbox.body.buf[0]; + } else { + *msb = 0xFFFFFFFF; + *lsb = 0xFFFFFFFF; + } +} + + diff --git a/lab2/lib/mmio.c b/lab2/lib/mmio.c new file mode 100644 index 000000000..ef9ba0d36 --- /dev/null +++ b/lab2/lib/mmio.c @@ -0,0 +1,11 @@ +#include "mmio.h" + +#include "stdint.h" + +void mmio_write(uint32_t reg, uint32_t data) { + *(volatile uint32_t*)(reg) = data; +} + +uint32_t mmio_read(uint32_t reg) { + return *(volatile uint32_t*)(reg); +} diff --git a/lab2/lib/shell.c b/lab2/lib/shell.c new file mode 100644 index 000000000..236954b22 --- /dev/null +++ b/lab2/lib/shell.c @@ -0,0 +1,113 @@ +#include "shell.h" + +char buf[0x100]; + +void welcome_msg() { + uart_write_string( + ENDL + " ____ _____ _____ ___ ___ ___ _ _" ENDL + " / __ \\ / ____| / ____| |__ \\ / _ \\ |__ \\ | || |" ENDL + " | | | || (___ | | ) || | | | ) || || |_" ENDL + " | | | | \\___ \\ | | / / | | | | / / |__ _|" ENDL + " | |__| | ____) || |____ / /_ | |_| | / /_ | | "ENDL + " \\____/ |_____/ \\_____| |____| \\___/ |____| |_|" ENDL); +} + +void read_cmd() { + char tmp; + uart_write_string("# "); + for (uint32_t i = 0; tmp = uart_read();) { + uart_write(tmp); + switch (tmp) { + case '\r': + case '\n': + buf[i++] = '\0'; + return; + case 127: // Backspace + if (i > 0) { + i--; + buf[i] = '\0'; + uart_write_string("\b \b"); + } + break; + default: + buf[i++] = tmp; + break; + } + } +} + +void exec_cmd() { + if (!strlen(buf)) return; + for (uint32_t i = 0; i < sizeof(func_list) / sizeof(struct func); i++) { + if (!strcmp(buf, func_list[i].name)) { + func_list[i].ptr(); + return; + } + } + cmd_unknown(); +} + +void cmd_help() { + for (uint32_t i = 0; i < sizeof(func_list) / sizeof(struct func); i++) { + uart_write_string(func_list[i].name); + for (uint32_t j = 0; j < (10 - strlen(func_list[i].name)); j++) uart_write(' '); + uart_write_string(": "); + uart_write_string(func_list[i].desc); + uart_write_string(ENDL); + } +} + +void cmd_hello() { + uart_write_string("Hello World!" ENDL); +} + + + +void cmd_sysinfo() { + uint32_t *board_revision; + uint32_t *board_serial_msb, *board_serial_lsb; + uint32_t *mem_base, *mem_size; + const int padding = 20; + + // Board Revision + get_board_revision(board_revision); + uart_write_string("Board Revision : 0x"); + uart_puth(*board_revision); + uart_write_string(ENDL); + + + // Memory Info + get_memory_info(mem_base, mem_size); + uart_write_string("Memroy Base Address : 0x"); + uart_puth(*mem_base); + uart_write_string(ENDL); + + uart_write_string("Memory Size : 0x"); + uart_puth(*mem_size); + uart_write_string(ENDL); +} + +void cmd_reboot() { + uart_write_string("Rebooting...."ENDL); + reset(10); +} + +void cmd_unknown() { + uart_write_string("Unknown command: "); + uart_write_string(buf); + uart_write_string(ENDL); +} + +void shell() { + welcome_msg(); + do { + read_cmd(); + + uart_write_string("# "); + uart_write_string(buf); + uart_write_string(ENDL); + + exec_cmd(); + } while (1); +} \ No newline at end of file diff --git a/lab2/lib/uart.c b/lab2/lib/uart.c new file mode 100644 index 000000000..490fc53d9 --- /dev/null +++ b/lab2/lib/uart.c @@ -0,0 +1,102 @@ +#include "uart.h" + +#include "mmio.h" +// #include "stdint.h" + +void uart_init() { + uint32_t t; + + /* Init GPIO */ + // mini UART -> set ALT5 + // Configure GPFSELn register to change alternate function + t = mmio_read(GPFSEL1); + t &= ~(7 << 12); // clean gpio14 + t |= (2 << 12); // set alt5 ,decimal(2) = binary(101) + t &= ~(7 << 15); // clean gpio15 + t |= (2 << 15); // set alt5 ,2 = 101 + mmio_write(GPFSEL1, t); + + /* Configure pull up/down register to disable GPIO pull up/down */ + /* P.101 + The GPIO Pull-up/down Clock Registers control the actuation of internal pull-downs on + the respective GPIO pins. These registers must be used in conjunction with the GPPUD + register to effect GPIO Pull-up/down changes. The following sequence of events is + required: + 1. Write to GPPUD to set the required control signal (i.e. Pull-up or Pull-Down or neither + to remove the current Pull-up/down) + 2. Wait 150 cycles – this provides the required set-up time for the control signal + 3. Write to GPPUDCLK0/1 to clock the control signal into the GPIO pads you wish to + modify – NOTE only the pads which receive a clock will be modified, all others will + retain their previous state. + 4. Wait 150 cycles – this provides the required hold time for the control signal + 5. Write to GPPUD to remove the control signal + 6. Write to GPPUDCLK0/1 to remove the clock + */ + mmio_write(GPPUD, 0); + delay(150); + mmio_write(GPPUDCLK0, (1 << 14) | (1 << 15)); + delay(150); + mmio_write(GPPUDCLK0, 0); + + /* Init mini UART */ + // 0. The MMIO area base address is 0x3F000000 on raspi3 + // 1. Set AUXENB register to enable mini UART. Then mini UART register can be accessed. + t = mmio_read(AUX_ENABLES); + mmio_write(AUX_ENABLES, t | 1); + + // 2. Set AUX_MU_CNTL_REG to 0. Disable transmitter and receiver during configuration. + mmio_write(AUX_MU_CNTL_REG, 0); + + // 3. Set AUX_MU_IER_REG to 0. Disable interrupt because currently you don’t need interrupt. + mmio_write(AUX_MU_IER_REG, 0); + + // 4. Set AUX_MU_LCR_REG to 3. Set the data size to 8 bit. + mmio_write(AUX_MU_LCR_REG, 3); + + // 5. Set AUX_MU_MCR_REG to 0. Don’t need auto flow control. + mmio_write(AUX_MU_MCR_REG, 0); + + // 6. Set AUX_MU_BAUD to 270. Set baud rate to 115200 + mmio_write(AUX_MU_BAUD_REG, 270); + + // 7. Set AUX_MU_IIR_REG to 6. No FIFO. + mmio_write(AUX_MU_IIR_REG, 6); + + // 8. Set AUX_MU_CNTL_REG to 3. Enable the transmitter and receiver. + mmio_write(AUX_MU_CNTL_REG, 3); + + // clear rx data + //uart_flush(); +} + +void uart_write(char c) { + while (!(mmio_read(AUX_MU_LSR_REG) & (1 << 5))) delay(1); + mmio_write(AUX_MU_IO_REG, c); +} + +char uart_read() { + while (!(mmio_read(AUX_MU_LSR_REG) & 1)) delay(1); + return (mmio_read(AUX_MU_IO_REG) & 0xff); +} + +void uart_flush() { + while (mmio_read(AUX_MU_LSR_REG) & 1) mmio_read(AUX_MU_IO_REG); +} + +void uart_write_string(char* str) { + for (uint32_t i = 0; str[i] != '\0'; i++) { + uart_write((char)str[i]); + } +} + +void uart_puth(uint32_t d) { + uint32_t c; + + for (int i = 28; i >= 0; i -= 4) { + /* Highest 4 bits */ + c = (d >> i) & 0xF; + /* Translate to hex */ + c = (c > 9) ? (0x37 + c) : (0x30 + c); + uart_write(c); + } +} \ No newline at end of file diff --git a/lab2/linker.ld b/lab2/linker.ld new file mode 100644 index 000000000..f51a65fe3 --- /dev/null +++ b/lab2/linker.ld @@ -0,0 +1,48 @@ +/* entry point */ +ENTRY(_start) + +SECTIONS +{ + /* start at LOADER_ADDR */ + . = 0x80000; + + __start = .; + __text_start = .; + .text : + { + KEEP(*(.text.boot)) + *(.text) + } + . = ALIGN(4096); /* align to page size */ + __text_end = .; + + . = ALIGN(4096); /* align to page size */ + .rodata : + { + *(.rodata) + } + __rodata_end = .; + + __data_start = .; + .data : + { + *(.data) + } + . = ALIGN(4096); /* align to page size */ + __data_end = .; + + __bss_start = .; + .bss : + { + bss = .; + *(.bss) + } + . = ALIGN(4096); /* align to page size */ + __bss_end = .; + __bss_size = __bss_end - __bss_start; + + . = 0x200000; + _estack = .; + + __end = .; +} \ No newline at end of file diff --git a/lab2/main.c b/lab2/main.c new file mode 100644 index 000000000..86e14f4a4 --- /dev/null +++ b/lab2/main.c @@ -0,0 +1,10 @@ +// #include "shell.h" +#include "stdint.h" +// #include "uart.h" + +void kernel_main(uint32_t r0, uint32_t r1, uint32_t atags) { + // initialize UART for Raspi2 + uart_init(); + + shell(); +} \ No newline at end of file diff --git a/lab2/main.o b/lab2/main.o new file mode 100644 index 0000000000000000000000000000000000000000..6395c8c5ad6b616ad62f620aa19cb813d23a4327 GIT binary patch literal 1656 zcmbVM-D(q25T4DpwrW~ht00Z&UIbClgDD8XtCgTt5HAElK}@&F)`ad4>>e@Ni~0x( z-s-hJfxQ#oz!%VW@BxB;lRaZkHd`+`%h{RvcD|W&W)8c5=fT~Ya|*G zL){=+;UI|f<`K<}E;^0+CGy~(XAp9MU$>W6KGr@tonJqf+5MmJ-skA|pQ;$Q@?=CV zo+@#XsY+a$pMe)A$Si((f>(8v>n8ndcl@g3RC(00Uqt008o%9jdI+pa@ zCN+=1DGr8->QS>#%@OT}SrSHF#^_~`>FzKY>cYyyq~FbTHcVb{UfF2_M_;lEN$oY@ zcDE*%1##y}xZHzv;P&w4JoCV7R(?|X>sSZd&^jyhK&&i`0;R)|Ce;sgKx#YBNo6TJ z9NtoGQoS^e!vrBoszZgldOg=cZx?aQ4hP+xEQmw9;<0QGENp#day~E?IbY$;&a8nC zd^>#!F#3sU#+LC Date: Wed, 13 Mar 2024 22:36:43 +0800 Subject: [PATCH 09/10] Finish boot.S relocation --- lab2/.gitignore | 5 ++++ lab2/bootloader/boot.S | 58 +++++++++++++++++++++++++++++++++++++++ lab2/bootloader/linker.ld | 47 +++++++++++++++++++++++++++++++ 3 files changed, 110 insertions(+) create mode 100644 lab2/.gitignore create mode 100644 lab2/bootloader/boot.S create mode 100644 lab2/bootloader/linker.ld diff --git a/lab2/.gitignore b/lab2/.gitignore new file mode 100644 index 000000000..d0238014a --- /dev/null +++ b/lab2/.gitignore @@ -0,0 +1,5 @@ +.vscode +gen.py +build/ +kernel8.img +kernel8.elf \ No newline at end of file diff --git a/lab2/bootloader/boot.S b/lab2/bootloader/boot.S new file mode 100644 index 000000000..dc2aef711 --- /dev/null +++ b/lab2/bootloader/boot.S @@ -0,0 +1,58 @@ +.section ".text.boot" + +.global _start + +// x0 register stores address to dtb +_start: + // Load the current location into register x20 (address of the current instruction) + adr x20, . + + // Load the size of the bootloader (_bl_size) into register x21 + ldr x21, =_bl_size + + // Calculate the end address of the bootloader by adding _bl_size to the current location + add x21, x21, x20 + + // Load the start address of the text section (_text_start) into register x22 + ldr x22, =_text_start + + // Copy the value of _text_start into register x19 for later use (initializing the stack pointer) + mov x19, x22 + + // Relocate the bootloader itself from 0x80000 to 0x60000. + // This loop copies the instructions of the bootloader from the current location (0x80000) to the new location (0x60000) +1: + cmp x20, x21 // Compare the current location (x20) with the end address of the bootloader (x21) + b.eq 2f // If they are equal, jump to label 2f (end of relocation) + ldr x23, [x20] // Load a 64-bit word from the current location (instruction of the bootloader) + str x23, [x22] // Store the loaded word to the new location (relocate the instruction) + add x20, x20, #8 // Move to the next instruction (increment by 8 bytes) + add x22, x22, #8 // Move to the next location to store the instruction + b 1b // Branch back to label 1 (continue relocation) + +2: + // Jump to the ".text._bl" section after relocation + ldr x1, =_bl_start // Load the address of the start of the bootloader section + br x1 // Branch to the start of the bootloader code + +.section ".text._bl" + // Initialize stack pointer (sp) to the start address of the text section + mov sp, x19 // Load the value of x19 (start address of text section) into the stack pointer (sp) + + // Clear the BSS section + ldr x20, =_bss_start // Load the start address of the BSS section + ldr x21, =_bss_size // Load the size of the BSS section + add x21, x21, x20 // Calculate the end address of the BSS section +3: + cmp x20, x21 // Compare the current location with the end address of the BSS section + b.eq 4f // If equal, exit loop + str xzr, [x20] // Store zero to the current location (clearing BSS) + add x20, x20, #8 // Move to the next location in the BSS section + b 3b // Branch back to label 3 (continue clearing BSS) + +4: + // Jump to the bootloader main function + bl bootloader_main // Call the bootloader main function +5: + // Failsafe loop to halt the core in case the main function returns + b 5b // Branch back to label 5 (infinite loop) diff --git a/lab2/bootloader/linker.ld b/lab2/bootloader/linker.ld new file mode 100644 index 000000000..9249f78da --- /dev/null +++ b/lab2/bootloader/linker.ld @@ -0,0 +1,47 @@ +/* entry point */ +ENTRY(_start) + +SECTIONS +{ + /* Move boot.S itslef from 0x80000 to 0x60000 */ + . = 0x60000; + + _text_start = .; + .text : + { + KEEP(*(.text.boot)) + _bl_start = .; + *(.text._bl) + *(.text) + } + . = ALIGN(0x1000); /* align to page size */ + _text_end = .; + + _data_start = .; + .data : + { + *(.data) + } + . = ALIGN(0x1000); /* align to page size */ + _data_end = .; + + _bss_start = .; + .bss : + { + bss = .; + *(.bss) + } + . = ALIGN(0x1000); /* align to page size */ + _bss_end = .; + _bss_size = _bss_end - _bss_start; + + . = 0x70000; + _stack_start = .; + + . = 0x80000; + _kernel_start = .; + + // Calculate the size of the bootloader by subtracting the start of the text section (_text_start) from the end of the BSS section (_bss_end). + // The bootloader includes the text, data, and BSS sections, hence the calculation. + _bl_size = _bss_end - _text_start; /* size of bootloader */ +}w \ No newline at end of file From 6bf4a6efdc8fa74bd861bf020756f60370788677 Mon Sep 17 00:00:00 2001 From: root Date: Thu, 14 Mar 2024 23:08:47 +0800 Subject: [PATCH 10/10] add gitignore and modify main.c --- lab1/.gitignore | 5 +++++ lab1/main.c | 1 - 2 files changed, 5 insertions(+), 1 deletion(-) create mode 100644 lab1/.gitignore diff --git a/lab1/.gitignore b/lab1/.gitignore new file mode 100644 index 000000000..d0238014a --- /dev/null +++ b/lab1/.gitignore @@ -0,0 +1,5 @@ +.vscode +gen.py +build/ +kernel8.img +kernel8.elf \ No newline at end of file diff --git a/lab1/main.c b/lab1/main.c index 86e14f4a4..1ae5aede3 100644 --- a/lab1/main.c +++ b/lab1/main.c @@ -5,6 +5,5 @@ void kernel_main(uint32_t r0, uint32_t r1, uint32_t atags) { // initialize UART for Raspi2 uart_init(); - shell(); } \ No newline at end of file