From a429d20e18aaf3d2f86ccf9821315095ee537a38 Mon Sep 17 00:00:00 2001 From: shibedrill Date: Thu, 20 Feb 2025 08:34:42 -0500 Subject: [PATCH] Minor fixes --- README.md | 17 +++++++++++++++-- limine.conf | 3 ++- src/main.rs | 4 +++- 3 files changed, 20 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index d7191c5..b074a45 100644 --- a/README.md +++ b/README.md @@ -15,8 +15,8 @@ Licensed under the GNU Public License v3. See [LICENSE](LICENSE) for details. ## Navigating -- [boot.rs](src/boot.rs): Handles bootloader handoff. Gila uses Limine. Other bootloaders are NOT supported. -- [display.rs](src/display.rs): Handles text-mode display via the VGA buffer. +- [arch/](src/arch/): Architecture specific features like the display, serial, and interrupts. Each architecture is a subfolder, containing a file or module for each feature. +- [boot.rs](src/boot.rs): Handles bootloader-managed data structures. Gila uses Limine. Other bootloaders are NOT supported. - [lib.rs](src/lib.rs): Glue to make all files accessible from [main.rs](src/main.rs). - [log.rs](src/log.rs): Logging structures and singletons for logging to serial or the display. - [main.rs](src/main.rs): The entry point that gets called by the bootloader. @@ -49,6 +49,19 @@ supplying [shell.nix](shell.nix) as an argument. TODO: The dockerfile is kinda broken and display forwarding does not work. +## Kernel Parameters + +Kernel parameters are passed as part of the `cmdline` through [limine.conf](limine.conf). The parameters are passed as a space-delimited list of keys and values. Keys begin with a hyphen (`-`), and keys are separated from their values with equals signs (`=`). Keys can have a set of multiple values, separated by a comma (`,`). Gila does not currently support parameter values with spaces. That would require an *actual* parser. + +List of current extant kernel parameters: + +- `-loglevel`: Can be a number or string corresponding to a log level. Only one value supported. +- `-logdev`: A sequence of one or more values representing devices to log to. Current options are `display` and `serial`. + +The default `cmdline` is: + +`-loglevel=INFO -logdev=display,serial` + ## Credits The linker script stuff is from [limine-rust-template](https://github.com/jasondyoungberg/limine-rust-template), diff --git a/limine.conf b/limine.conf index 87c02e8..ec726eb 100644 --- a/limine.conf +++ b/limine.conf @@ -2,4 +2,5 @@ timeout: 5 /Gila protocol: limine - kernel_path: boot():/gila \ No newline at end of file + kernel_path: boot():/gila + cmdline: -loglevel=INFO -logdev=display,serial \ No newline at end of file diff --git a/src/main.rs b/src/main.rs index cc58211..a3372bb 100644 --- a/src/main.rs +++ b/src/main.rs @@ -43,6 +43,7 @@ unsafe extern "C" fn main() -> ! { if log_device_list.contains(&"serial") { // Append serial console to log subs } + log(LogLevel::INFO, "Configured kernel logging devices.") } { @@ -65,7 +66,8 @@ unsafe extern "C" fn main() -> ! { } } - log(LogLevel::INFO, "Booting Gila..."); + log(LogLevel::INFO, "Log devices configured. Booting `gila`."); + log(LogLevel::INFO, "Trans Rights!"); let _smp_response = SMP_REQUEST.get_response();