finish exec3.3

This commit is contained in:
KAAAsS 2021-05-15 00:15:51 +08:00
parent 830283078f
commit 37f581eb6a
Signed by: KAAAsS
GPG Key ID: D56625F3E671882F
3 changed files with 30 additions and 1 deletions

View File

@ -13,4 +13,4 @@ define add-symbol-file-auto
end
add-symbol-file-auto ./build/kernel.img
add-symbol-file-auto ./user/build/ramdisk/hello.bin
add-symbol-file-auto ./user/build/ramdisk/badinsn.bin

View File

@ -25,6 +25,7 @@ void exception_init_per_cpu(void)
* Lab3: Your code here
* Setup the exception vector with the asm function written in exception.S
*/
set_exception_vector();
disable_irq();
}
@ -48,6 +49,10 @@ void handle_entry_c(int type, u64 esr, u64 address)
* Handle exceptions as required in the lab document. Checking exception codes in
* esr.h may help.
*/
case ESR_EL1_EC_UNKNOWN:
// Unknown instruction
kinfo("%s", UNKNOWN);
sys_exit(-ESUPPORT);
default:
kdebug("Unsupported Exception ESR %lx\n", esr);
break;

View File

@ -120,6 +120,30 @@
.align 11
EXPORT(el1_vector)
// ELx SP_EL0
exception_entry sync_el1t
exception_entry irq_el1t
exception_entry fiq_el1t
exception_entry error_el1t
// ELx SP_ELx
exception_entry sync_el1h
exception_entry irq_el1h
exception_entry fiq_el1h
exception_entry error_el1h
// EL0 AArch64
exception_entry sync_el0_64
exception_entry irq_el0_64
exception_entry fiq_el0_64
exception_entry error_el0_64
// EL0 AArch32
exception_entry sync_el0_32
exception_entry irq_el0_32
exception_entry fiq_el0_32
exception_entry error_el0_32
sync_el1t:
handle_entry 1, SYNC_EL1t