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

2022-01-28 Thread Samuel Thibault
Luca Dariz, le ven. 28 janv. 2022 19:24:06 +0100, a ecrit: > it seems rbx is corrupted during interrupt handlers. Perhaps just use rcx instead? Samuel

Re: [PATCH 4/6] fix console setting from cmdline

2022-01-28 Thread Samuel Thibault
Luca Dariz, le ven. 28 janv. 2022 19:24:07 +0100, a ecrit: > The leading space prevents it working if console=comX is the only > argument. But it would be confused with another parameter which would be foobarconsole=bla You'd probably want to make the code also try strncmp(kernel_cmdline, CONSOLE

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

2022-01-28 Thread Samuel Thibault
Hello, Luca Dariz, le ven. 28 janv. 2022 19:24:04 +0100, a ecrit: > * link kernel at 0x400 as the xen version, higher values causes > linker errors. > * we can't use full segmentation in long mode, so we need to create a > temporary mapping during early boot to be able to jump to high >

[PATCH 4/6] fix console setting from cmdline

2022-01-28 Thread Luca Dariz
The leading space prevents it working if console=comX is the only argument. Signed-off-by: Luca Dariz --- i386/i386at/com.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/i386/i386at/com.c b/i386/i386at/com.c index 3402a025..d1de51c0 100644 --- a/i386/i386at/com.c +++ b/i386

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

2022-01-28 Thread Luca Dariz
it seems rbx is corrupted during interrupt handlers. This appears on first call to thread_continue() Signed-off-by: Luca Dariz --- x86_64/interrupt.S | 2 ++ 1 file changed, 2 insertions(+) diff --git a/x86_64/interrupt.S b/x86_64/interrupt.S index eab643a5..4ea849af 100644 --- a/x86_64/interru

[PATCH 5/6] enable user access

2022-01-28 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 91835b30..

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

2022-01-28 Thread Luca Dariz
* link kernel at 0x400 as the xen version, higher values causes linker errors. * we can't use full segmentation in long mode, so we need to create a temporary mapping during early boot to be able to jump to high addresses * build direct map for first 4G in boothdr (seems required by Linux

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

2022-01-28 Thread Luca Dariz
These patches enable basic support for booting the x86_64 build on qemu. It's possible to load the bootstrap modules (32-bit for now) but they can't do much yet. This seems more or less in line with the xen port. Next steps (in no particular order): * test simple syscalls, e.g. mach_tsk_self(), ma

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

2022-01-28 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 2/6] cleanup multiboot

2022-01-28 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 +---