summaryrefslogtreecommitdiff
path: root/src/kernel/kernel.c
diff options
context:
space:
mode:
authorAndreas Baumann <mail@andreasbaumann.cc>2018-01-05 20:52:57 +0100
committerAndreas Baumann <mail@andreasbaumann.cc>2018-01-05 20:52:57 +0100
commit8f3c73740a30ad02a594e21a52d47aa4ae9efe91 (patch)
tree3507da836c7a346371a1af8bbcfd56fb1dd707bf /src/kernel/kernel.c
parent24de320bb1d63beefd5bc89c97b4ad727d8e05e7 (diff)
downloadabaos-8f3c73740a30ad02a594e21a52d47aa4ae9efe91.tar.gz
abaos-8f3c73740a30ad02a594e21a52d47aa4ae9efe91.tar.bz2
some preliminary work on an UDP netconsole
Diffstat (limited to 'src/kernel/kernel.c')
-rw-r--r--src/kernel/kernel.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/src/kernel/kernel.c b/src/kernel/kernel.c
index e431327..11d35ce 100644
--- a/src/kernel/kernel.c
+++ b/src/kernel/kernel.c
@@ -49,6 +49,7 @@ typedef enum {
typedef struct {
vga_text_t vga_text;
+ console_t console;
driver_manager_t driver_manager;
task_manager_t task_manager;
memory_manager_t memory_manager;
@@ -85,13 +86,12 @@ void kernel_main( void )
vga_text_set_color( &global_context.vga_text, VGA_TEXT_COLOR_LIGHT_GREY );
vga_text_set_background_color( &global_context.vga_text, VGA_TEXT_COLOR_BLACK );
- console_t console;
- console_init( &console );
- console_add_vga_text_output( &console, &global_context.vga_text );
- console_add_serial_output( &console, &serial );
+ console_init( &global_context.console );
+ console_add_vga_text_output( &global_context.console, &global_context.vga_text );
+ console_add_serial_output( &global_context.console, &serial );
// initialize the early console of the kernel
- __stdio_set_console( &console );
+ __stdio_set_console( &global_context.console );
puts( "Started early kernel console" );
// TODO: get those values somehow from the boot loader
printf( "Kernel code and data is at 0x%X, kernel stack at 0x%X\n", 0x8800, 0x90000 );
@@ -482,6 +482,11 @@ void handle_network_event( network_event_t *event, void *context )
src_mac_addr, dst_mac_addr, src_ip, dst_ip, arp->operation >> 8 );
// TODO: remember the address mapping
+
+ // enable network logging
+ // TODO: for now we sent back to the machine sending us the first ARP request,
+ // whether or not that one is listing to funny UDP console packets or not.. :-)
+ console_add_network_output( &global_context.console, global_context.network );
// send answer
packet->header.dst_addr = arp->source_hardware_address;