sudharson14 / xv6-OS-for-arm-v8

OS support for 64 bit ARM architecture
44 stars 23 forks source link

Timer interrupt function for AArch64 #7

Open takeharukato opened 6 years ago

takeharukato commented 6 years ago

Hi,

I wrote a patch to add the timer interrupt function including the kernel level preemption support.

This patch contains:

(1) Add the timer interrupt facility using the virtual timer (2) Add the kernel level preemption function as same as xv6 for IA32. Note: Xv6 for IA32 breaks delayed dispatching for now due to its wrong exception handling. I kept this behavior on purpose to keep the compatibility between AArch64 and IA32. (3) Enable timer initialization and the preempt test in usertests.

In addition to this, would you please notice that this PR contains my previous PRs ( #3, #4, #6 ) because this PR needs them.

Now, xv6 for AArch64 can run the preempt test in usertests correctly.

$ ./run.sh
run armv8 without qemu.log

starting xv6 for ARMv8...
Implementer: ARM Limited
Current EL: EL1
Flushing TLB and Instr Cache
Setting Memory Attribute Indirection Register (MAIR_EL1)
Setting Vector Base Address Register (VBAR_EL1)
Setting Translation Control Register (TCR_EL1)
Setting Translation Table Base Register 1 (TTBR1_EL1)
Setting Translation Table Base Register 0 (TTBR0_EL1)
Setting System Control Register (SCTLR_EL1)
System Configure Completed...

clearing BSS section for the main kernel
Starting Kernel

**************************************************************************
**                                                                      **
**                                                                      **
**                  xv6 on ARMv8-A (64-bit) Architecture                **
**                                                                      **
**                                                                      **
**************************************************************************

init: Starting Shell
$ usertests
usertests starting
bigarg test
bigarg test ok
bigwrite test
bigwrite ok
bigarg test
bigarg test ok
bss test
bss test ok
sbrk test
Data abort  esr 92000006 on cpu 0 pc 0x393c addr 0xffffffff00000000 -- kill proc
Data abort  esr 92000006 on cpu 0 pc 0x393c addr 0xffffffff0000c350 -- kill proc
Data abort  esr 92000006 on cpu 0 pc 0x393c addr 0xffffffff000186a0 -- kill proc
Data abort  esr 92000006 on cpu 0 pc 0x393c addr 0xffffffff000249f0 -- kill proc
Data abort  esr 92000006 on cpu 0 pc 0x393c addr 0xffffffff00030d40 -- kill proc
Data abort  esr 92000006 on cpu 0 pc 0x393c addr 0xffffffff0003d090 -- kill proc
Data abort  esr 92000006 on cpu 0 pc 0x393c addr 0xffffffff000493e0 -- kill proc
Data abort  esr 92000006 on cpu 0 pc 0x393c addr 0xffffffff00055730 -- kill proc
Data abort  esr 92000006 on cpu 0 pc 0x393c addr 0xffffffff00061a80 -- kill proc
Data abort  esr 92000006 on cpu 0 pc 0x393c addr 0xffffffff0006ddd0 -- kill proc
Data abort  esr 92000006 on cpu 0 pc 0x393c addr 0xffffffff0007a120 -- kill proc
Data abort  esr 92000006 on cpu 0 pc 0x393c addr 0xffffffff00086470 -- kill proc
Data abort  esr 92000006 on cpu 0 pc 0x393c addr 0xffffffff000927c0 -- kill proc
Data abort  esr 92000006 on cpu 0 pc 0x393c addr 0xffffffff0009eb10 -- kill proc
Data abort  esr 92000006 on cpu 0 pc 0x393c addr 0xffffffff000aae60 -- kill proc
Data abort  esr 92000006 on cpu 0 pc 0x393c addr 0xffffffff000b71b0 -- kill proc
Data abort  esr 92000006 on cpu 0 pc 0x393c addr 0xffffffff000c3500 -- kill proc
Data abort  esr 92000006 on cpu 0 pc 0x393c addr 0xffffffff000cf850 -- kill proc
Data abort  esr 92000006 on cpu 0 pc 0x393c addr 0xffffffff000dbba0 -- kill proc
Data abort  esr 92000006 on cpu 0 pc 0x393c addr 0xffffffff000e7ef0 -- kill proc
Data abort  esr 92000006 on cpu 0 pc 0x393c addr 0xffffffff000f4240 -- kill proc
Data abort  esr 92000006 on cpu 0 pc 0x393c addr 0xffffffff00100590 -- kill proc
Data abort  esr 92000006 on cpu 0 pc 0x393c addr 0xffffffff0010c8e0 -- kill proc
Data abort  esr 92000006 on cpu 0 pc 0x393c addr 0xffffffff00118c30 -- kill proc
Data abort  esr 92000006 on cpu 0 pc 0x393c addr 0xffffffff00124f80 -- kill proc
Data abort  esr 92000006 on cpu 0 pc 0x393c addr 0xffffffff001312d0 -- kill proc
Data abort  esr 92000006 on cpu 0 pc 0x393c addr 0xffffffff0013d620 -- kill proc
Data abort  esr 92000006 on cpu 0 pc 0x393c addr 0xffffffff00149970 -- kill proc
Data abort  esr 92000006 on cpu 0 pc 0x393c addr 0xffffffff00155cc0 -- kill proc
Data abort  esr 92000006 on cpu 0 pc 0x393c addr 0xffffffff00162010 -- kill proc
Data abort  esr 92000006 on cpu 0 pc 0x393c addr 0xffffffff0016e360 -- kill proc
Data abort  esr 92000006 on cpu 0 pc 0x393c addr 0xffffffff0017a6b0 -- kill proc
Data abort  esr 92000006 on cpu 0 pc 0x393c addr 0xffffffff00186a00 -- kill proc
Data abort  esr 92000006 on cpu 0 pc 0x393c addr 0xffffffff00192d50 -- kill proc
Data abort  esr 92000006 on cpu 0 pc 0x393c addr 0xffffffff0019f0a0 -- kill proc
Data abort  esr 92000006 on cpu 0 pc 0x393c addr 0xffffffff001ab3f0 -- kill proc
Data abort  esr 92000006 on cpu 0 pc 0x393c addr 0xffffffff001b7740 -- kill proc
Data abort  esr 92000006 on cpu 0 pc 0x393c addr 0xffffffff001c3a90 -- kill proc
Data abort  esr 92000006 on cpu 0 pc 0x393c addr 0xffffffff001cfde0 -- kill proc
Data abort  esr 92000006 on cpu 0 pc 0x393c addr 0xffffffff001dc130 -- kill proc
allocuvm out of memory
allocuvm out of memory
allocuvm out of memory
allocuvm out of memory
allocuvm out of memory
allocuvm out of memory
allocuvm out of memory
allocuvm out of memory
allocuvm out of memory
sbrk test OK
validate test
validate ok
open test
open test ok
small file test
creat small succeeded; ok
writes ok
open small succeeded ok
read succeeded ok
small file test ok
big files test
big files ok
many creates, followed by unlink test
many creates, followed by unlink; ok
mem test
allocuvm out of memory
mem ok
pipe1 ok
preempt: kill... wait... preempt ok
exitwait ok
rmdot test
rmdot ok
fourteen test
fourteen ok
bigfile test
bigfile test ok
subdir test
subdir ok
concreate test
concreate ok
linkunlink test
linkunlink ok
linktest
linktest ok
unlinkread test
unlinkread ok
createdelete test
createdelete ok
twofiles test
twofiles ok
sharedfd test
sharedfd ok
dir vs file
dir vs file OK
empty file name
empty file name OK
fork test
fork test OK
bigdir test
bigdir ok
exec test
ALL TESTS PASSED
$

Would you please merge this PR?

Thanks, Regards,