diff --git a/Lab3/ramdisk/userland.bin b/Lab3/ramdisk/userland.bin index 80cd5ef9..4d1e2414 100755 Binary files a/Lab3/ramdisk/userland.bin and b/Lab3/ramdisk/userland.bin differ diff --git a/Lab3/user/chcore-libc/libchcore/cmake/do_override_dir.sh b/Lab3/user/chcore-libc/libchcore/cmake/do_override_dir.sh index 8b92ea14..bac69e4c 100644 --- a/Lab3/user/chcore-libc/libchcore/cmake/do_override_dir.sh +++ b/Lab3/user/chcore-libc/libchcore/cmake/do_override_dir.sh @@ -14,15 +14,15 @@ set -e self=`basename "$0"` function usage { - echo "Usage: $self [overrides_absolute_path] [target_absolute_path]" + echo "Usage: $self [[overrides_absolute_path]] [[target_absolute_path]]" exit 1 } -if [ "$#" -ne 2 ]; then +if [[ "$#" -ne 2 ]]; then usage fi -if [[ $1 != /* ]] || [[ $2 != /* ]]; then +if [[[[ $1 != /* ]]]] || [[[[ $2 != /* ]]]]; then usage fi @@ -63,28 +63,29 @@ function traverse { rel_path=${file#$overrides/} target_file=$target/$rel_path - if [ -d "$file" ]; then - if [ ! -e "$target_file" ]; then + if [[ -d "$file" ]]; then + if [[ ! -e "$target_file" ]]; then ln -sf "$file" "$target_file" echo "--- Overrided ${target_file} with ${file} symlink" - elif [ ! -L "$target_file" ]; then + elif [[ ! -L "$target_file" ]]; then traverse "$file" else echo "--- Target directory ${target_file} has been overrided, skipping..." fi - elif [ -f "$file" ]; then - if [ ! -s "$file" ]; then - if [ -e "$target_file" ]; then - mv "$target_file" "$target_file.bak" + elif [[ -f "$file" ]]; then + if [[ "$file" == *.del ]]; then + target_file="${target_file%.del}" + if [[ -e "${target_file}" ]]; then + mv "${target_file}" "$target_file.bak" echo "--- Overrided ${target_file} with ${file}" else echo "--- Target file ${target_file} has been deleted, skipping..." fi else - if [ ! -e "$target_file" ]; then + if [[ ! -e "$target_file" ]]; then ln -sf "$file" "$target_file" echo "--- Overrided ${target_file} with ${file}" - elif [ ! -L "$target_file" ]; then + elif [[ ! -L "$target_file" ]]; then mv "$target_file" "$target_file.bak" ln -sf "$file" "$target_file" echo "--- Overrided ${target_file} with ${file}" diff --git a/Lab3/user/chcore-libc/libchcore/porting/overrides/src/thread/aarch64/__thread_exit.S b/Lab3/user/chcore-libc/libchcore/porting/overrides/src/thread/aarch64/__thread_exit.S old mode 100755 new mode 100644 diff --git a/Lab3/user/chcore-libc/libchcore/porting/overrides/src/thread/aarch64/__unmapself.s.del b/Lab3/user/chcore-libc/libchcore/porting/overrides/src/thread/aarch64/__unmapself.s.del new file mode 100644 index 00000000..e69de29b diff --git a/Lab4/filelist.mk b/Lab4/filelist.mk index a0ff51d1..c25f517f 100644 --- a/Lab4/filelist.mk +++ b/Lab4/filelist.mk @@ -7,7 +7,7 @@ SCHEDULER := $(SCHED)/sched.c RR := $(SCHED)/policy_rr.c ARCH_TIMER := $(ARCH_IRQ)/timer.c IRQ := $(ARCH_IRQ)/irq.c -KERNEL_TIMER := $(IRQ)/timer.c +KERNEL_TIMER := $(KERNEL_IRQ)/timer.c CONNECTION := $(IPC)/connection.c FILES := $(SCHEDULER) \ diff --git a/Lab4/kernel/CMakeLists.txt b/Lab4/kernel/CMakeLists.txt index bd8724c4..80237fb4 100644 --- a/Lab4/kernel/CMakeLists.txt +++ b/Lab4/kernel/CMakeLists.txt @@ -137,7 +137,7 @@ macro(_kernel_incbin _binary_name _binary_path) endmacro() # Include essential user-level binaries -_kernel_incbin(procmgr_bin ${CMAKE_CURRENT_SOURCE_DIR}/../user/procmgr) +_kernel_incbin(procmgr_bin ${CHCORE_USER_INSTALL_DIR}/system-servers/procmgr/procmgr) # Rebuild kernel when ramdisk changes add_custom_target(touch-inc-procmgr diff --git a/Lab4/user/chcore-libc/libchcore/cmake/do_override_dir.sh b/Lab4/user/chcore-libc/libchcore/cmake/do_override_dir.sh index 8b92ea14..bac69e4c 100644 --- a/Lab4/user/chcore-libc/libchcore/cmake/do_override_dir.sh +++ b/Lab4/user/chcore-libc/libchcore/cmake/do_override_dir.sh @@ -14,15 +14,15 @@ set -e self=`basename "$0"` function usage { - echo "Usage: $self [overrides_absolute_path] [target_absolute_path]" + echo "Usage: $self [[overrides_absolute_path]] [[target_absolute_path]]" exit 1 } -if [ "$#" -ne 2 ]; then +if [[ "$#" -ne 2 ]]; then usage fi -if [[ $1 != /* ]] || [[ $2 != /* ]]; then +if [[[[ $1 != /* ]]]] || [[[[ $2 != /* ]]]]; then usage fi @@ -63,28 +63,29 @@ function traverse { rel_path=${file#$overrides/} target_file=$target/$rel_path - if [ -d "$file" ]; then - if [ ! -e "$target_file" ]; then + if [[ -d "$file" ]]; then + if [[ ! -e "$target_file" ]]; then ln -sf "$file" "$target_file" echo "--- Overrided ${target_file} with ${file} symlink" - elif [ ! -L "$target_file" ]; then + elif [[ ! -L "$target_file" ]]; then traverse "$file" else echo "--- Target directory ${target_file} has been overrided, skipping..." fi - elif [ -f "$file" ]; then - if [ ! -s "$file" ]; then - if [ -e "$target_file" ]; then - mv "$target_file" "$target_file.bak" + elif [[ -f "$file" ]]; then + if [[ "$file" == *.del ]]; then + target_file="${target_file%.del}" + if [[ -e "${target_file}" ]]; then + mv "${target_file}" "$target_file.bak" echo "--- Overrided ${target_file} with ${file}" else echo "--- Target file ${target_file} has been deleted, skipping..." fi else - if [ ! -e "$target_file" ]; then + if [[ ! -e "$target_file" ]]; then ln -sf "$file" "$target_file" echo "--- Overrided ${target_file} with ${file}" - elif [ ! -L "$target_file" ]; then + elif [[ ! -L "$target_file" ]]; then mv "$target_file" "$target_file.bak" ln -sf "$file" "$target_file" echo "--- Overrided ${target_file} with ${file}" diff --git a/Lab4/user/chcore-libc/libchcore/porting/overrides/src/thread/aarch64/__unmapself.s.del b/Lab4/user/chcore-libc/libchcore/porting/overrides/src/thread/aarch64/__unmapself.s.del new file mode 100644 index 00000000..e69de29b diff --git a/Lab4/user/procmgr b/Lab4/user/procmgr deleted file mode 100755 index def3709e..00000000 Binary files a/Lab4/user/procmgr and /dev/null differ diff --git a/Lab4/user/system-services/system-servers/procmgr/procmgr.c b/Lab4/user/system-services/system-servers/procmgr/procmgr.c index 48a6a593..33628190 100644 --- a/Lab4/user/system-services/system-servers/procmgr/procmgr.c +++ b/Lab4/user/system-services/system-servers/procmgr/procmgr.c @@ -645,20 +645,10 @@ void boot_default_apps(void) /* Start shell. */ - char *userland_argv= "userland.bin"; + char *test_ipc_argv= "test_ipc.bin"; (void)procmgr_launch_process(1, - &userland_argv, - "userland", - true, - INIT_BADGE, - NULL, - COMMON_APP, - NULL); - - char *hello_world_argv= "hello_world.bin"; - (void)procmgr_launch_process(1, - &hello_world_argv, - "hello_world", + &test_ipc_argv, + "test_ipc", true, INIT_BADGE, NULL,