summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndreas Baumann <mail@andreasbaumann.cc>2017-07-20 09:25:18 +0200
committerAndreas Baumann <mail@andreasbaumann.cc>2017-07-20 09:25:18 +0200
commit43fcc1ca57149c5a87502f0c23a2c85e4d28264a (patch)
treedbfa9ec6442959723480a33c8cc4dcc317092a09 /src
parentee3e51aa1624693217b1a4ae7bfb2730424c08f2 (diff)
downloadabaos-43fcc1ca57149c5a87502f0c23a2c85e4d28264a.tar.gz
abaos-43fcc1ca57149c5a87502f0c23a2c85e4d28264a.tar.bz2
kernel_panic while shutting down does not result in endless loops anymore
Diffstat (limited to 'src')
-rw-r--r--src/kernel/kernel.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/kernel/kernel.c b/src/kernel/kernel.c
index 4314ca8..9bb1054 100644
--- a/src/kernel/kernel.c
+++ b/src/kernel/kernel.c
@@ -105,6 +105,12 @@ void kernel_main( void )
// exit point in case of kernel panic, do this as soon as
// possible, as soon we have an early console we can croak on
if( setjmp( panic_jmp_buf ) > 0 ) {
+ // reset the panic jump point to the really end to avoid
+ // endless loops when something bad happens while shutting
+ // down
+ if( setjmp( panic_jmp_buf ) > 0 ) {
+ goto ABORT;
+ }
goto TERMINATE;
}
@@ -121,12 +127,6 @@ void kernel_main( void )
puts( "Initializing drivers" );
driver_manager_init( &global_context.driver_manager );
- // exit point in case of kernel panic, do this as soon as
- // possible
- if( setjmp( panic_jmp_buf ) > 0 ) {
- goto TERMINATE;
- }
-
// hard-wired drivers
global_context.keyboard = (keyboard_t *)malloc( sizeof( keyboard_t ) );
@@ -173,6 +173,7 @@ TERMINATE:
driver_manager_deinit( &global_context.driver_manager );
+ABORT:
puts( "Kernel terminated" );
}