From 8f3c73740a30ad02a594e21a52d47aa4ae9efe91 Mon Sep 17 00:00:00 2001 From: Andreas Baumann Date: Fri, 5 Jan 2018 20:52:57 +0100 Subject: some preliminary work on an UDP netconsole --- src/kernel/kernel.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'src/kernel/kernel.c') 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; -- cgit v1.2.3-54-g00ecf