[PATCH 5/6] enable user access

2022-02-05 Thread Luca Dariz
The pmap module is a bit limited on 64 bit paging, so this should be refined when we'll be able to use addresses over 4G. Signed-off-by: Luca Dariz --- i386/intel/pmap.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/i386/intel/pmap.c b/i386/intel/pmap.c index d0bd3b5d..

[PATCH 4/6] fix console setting from cmdline

2022-02-05 Thread Luca Dariz
The leading space prevents it working if console=comX is the only argument, so handle this case separately. Signed-off-by: Luca Dariz --- i386/i386at/com.c | 5 + 1 file changed, 5 insertions(+) diff --git a/i386/i386at/com.c b/i386/i386at/com.c index 3402a025..fb291b87 100644 --- a/i386/i3

[PATCH 2/6] cleanup multiboot

2022-02-05 Thread Luca Dariz
* use _raw_ structs where we refer to the bootloader-provided data * remove unused structures * fix 64 bit boot Signed-off-by: Luca Dariz --- Makefrag.am| 1 - i386/i386at/model_dep.c| 23 +++--- i386/include/mach/i386/multiboot.h | 108 +---

[PATCH 6/6] fix Task State Segment layout for 64 bit

2022-02-05 Thread Luca Dariz
Signed-off-by: Luca Dariz --- i386/i386/i386asm.sym | 4 i386/i386/ktss.c | 8 ++-- i386/i386/pcb.c | 4 i386/i386/tss.h | 24 ++-- 4 files changed, 36 insertions(+), 4 deletions(-) diff --git a/i386/i386/i386asm.sym b/i386/i386/i386asm.sym i

[PATCH 1/6] add support for booting from grub with x86_64

2022-02-05 Thread Luca Dariz
* configure: compile for native x86_64 by default instead of xen * x86_64/Makefrag.am: introduce KERNEL_MAP_BASE to reuse the constant in both code and linker script * x86_64/ldscript: use a .boot section for the very first operations, until we reach long mode. This section is not really alloca

[PATCH 3/6] fix register corruption in irq on qemu

2022-02-05 Thread Luca Dariz
rbx was used to compute the irq index in iunit and ivect arrays, however it should be preserved by pushing it in to the stack. As a solution, we use rax instead, that is preserved across function calls and is not used as a function argument. Signed-off-by: Luca Dariz --- x86_64/interrupt.S | 12

[PATCH v2 0/6] Add initial support for booting x86_64 from grub

2022-02-05 Thread Luca Dariz
Updates from previous submission: * added more description of the changes in the commit message * removed some minor changes needed only when running the kernel from high addreses (>4G), currently it fails to link and it will be handled in another patch * updated pre-processor condition for wri