Just had a go at amd64 GENERIC_USERMODE. Am I missing something or should
it be as easy as build netbsd and run it?
I see (netbsd.gdb -vx):
Information retrieved from system and elf image
min VM address at 0x1000
start kernel at 0x40000000
end kernel at 0x4020d41e
end of init. data at 0x40519430
1st end of data at 0x4055e688
CUR end data at 0x4055e688
^MMemory summary
^M kmem_user_start 0x1000
^M kmem_user_end 0x2fc00000
^M kmem_k_start 0x40000000
^M kmem_k_end 0x4020e000
^M kmem_kvm_start 0x2fe00000
^M kmem_kvm_end 0x3fe00000
^M DRAM_cfg 1073741824
^M kvmsize 268435456
^M user_len 801107968
^MCreating memory mapped backend
claiming 10240 KB of pv_table for 262144 pages of physical memory
tlb va->pa lookup table is 2048 KB for 262143 logical pages
pv_table initialiased correctly, mmap works
kernel tlb entries initialized correctly
kernel pmap l1 table initialiased correctly
pmap_kenter_pa : v 0x2fe00000, p 0x0, prot 3, flags 0
pmap_update_page: ppn 0, pv->pv_map = 0x40533fc0
page_activate: (va 0x2fe00000, pa 0x0, prot 3, ppl 3) -> 0x2fe00000
page_activate: (va 0x2fe00000, pa 0x0, prot 3, ppl 3) -> 0x2fe00000
...
pmap_update_page: ppn 3584, pv->pv_map = 0x40533fc0
page_activate: (va 0x30c00000, pa 0xe00000, prot 3, ppl 3) -> 0x30c00000
page_activate: (va 0x30c00000, pa 0xe00000, prot 3, ppl 3) -> 0x30c00000
kernel pmap entries mem added to the kernel pmap
Program received signal SIGSYS, Bad system call.
0x00000000401ed46a in syscall ()
(gdb) bt
#0 0x00000000401ed46a in syscall ()
#1 0x0000000040000489 in thunk_syscallemu_init (ustart=0x1000,
uend=0x2fc00000) at ../../../../arch/usermode/usermode/thunk.c:121
#2 0x00000000400e1f79 in pmap_bootstrap ()
at ../../../../arch/usermode/usermode/pmap.c:420
#3 0x00000000400af15a in main (argc=<optimized out>, argv=0x7f7fffffdb60)
at ../../../../arch/usermode/usermode/machdep.c:219
I wonder which syscall() function is called, as I
Index: usermode/syscall.c
===================================================================
RCS file: /cvsroot/src/sys/arch/usermode/usermode/syscall.c,v
retrieving revision 1.24
diff -u -r1.24 syscall.c
--- usermode/syscall.c 26 Jun 2013 15:11:30 -0000 1.24
+++ usermode/syscall.c 6 Feb 2015 10:31:45 -0000
@@ -113,7 +113,7 @@
rval[0] = rval[1] = 0;
error = md_syscall_getargs(l, ucp, nargs, argsize, args);
-#if 0
+#if 1
aprint_debug("syscall no. %d, ", code);
aprint_debug("nargs %d, argsize %d => ", nargs, argsize);
thunk_printf_debug("syscall no. %d, ", code);
so expected to see some printout, or?
Cheers,
Patrick