From d63c9d0f085ebb58d283ba7e037a1235b7d4167c Mon Sep 17 00:00:00 2001 From: kwikner Date: Sun, 16 Jul 2023 01:39:35 +0200 Subject: [PATCH 1/2] README: mtools dependency --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 69f3598d..ef1d4851 100644 --- a/README.md +++ b/README.md @@ -47,7 +47,7 @@ make boot You may need to install the following (unless you already have it): * GRUB2 bootloader tools - `grub2-common` package (e.g. `apt install grub2-common`) -* ISO generation tools - `xorriso` package (e.g. `apt install xorriso`) +* ISO generation tools - `xorriso` and `mtools` package (e.g. `apt install xorriso mtools`) #### Kernel image build (for example to be used with QEMU) From 32ae36d0792b07947c2b2546053cb2a683d26ea4 Mon Sep 17 00:00:00 2001 From: kwikner Date: Fri, 21 Jul 2023 10:38:58 +0200 Subject: [PATCH 2/2] usermode: syscall_handler set return with asm The previous method would get optimized out by compiler. Using asm volatile instead. Signed-off-by: Johannes Wikner --- common/usermode.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/common/usermode.c b/common/usermode.c index 45915c36..ecc254f1 100644 --- a/common/usermode.c +++ b/common/usermode.c @@ -49,8 +49,13 @@ static inline void syscall_restore(void) { } static inline long syscall_return(long return_code) { - register long ret asm(STR(_ASM_AX)) = return_code; - return ret; + /* clang-format off */ + asm volatile( + "mov %[ret], %%" STR(_ASM_AX) "\n" + ::[ret] "r"(return_code) + ); + /* clang-format on */ + return return_code; } static inline void stack_switch(void) {