boot: first pass at cleanup, just make sure everything has lead comments
This commit is contained in:
parent
c7429e9055
commit
dea94e3c5b
@ -1,3 +1,18 @@
|
||||
/**
|
||||
* @brief Shared bootloader configuration.
|
||||
*
|
||||
* Sets up menus that present the boot options for both the EFI
|
||||
* and BIOS loaders. If you want to tweak ToaruOS's bootloader
|
||||
* to boot some other Multiboot1-compliant OS, start here.
|
||||
*
|
||||
* This is also the place to add new default startup configs,
|
||||
* add toggles for command line options, and so on.
|
||||
*
|
||||
* @copyright
|
||||
* This file is part of ToaruOS and is released under the terms
|
||||
* of the NCSA / University of Illinois License - see LICENSE.md
|
||||
* Copyright (C) 2018-2021 K. Lange
|
||||
*/
|
||||
#include <stdint.h>
|
||||
#include <stddef.h>
|
||||
|
||||
|
@ -1,3 +1,16 @@
|
||||
/**
|
||||
* @brief Command line editor.
|
||||
*
|
||||
* Very rudimentary command line editor so options can be
|
||||
* tweaked. Has a couple of nice features like being
|
||||
* able to move the cursor. Not intended to be all that
|
||||
* robust, and needs to work in EFI and BIOS.
|
||||
*
|
||||
* @copyright
|
||||
* This file is part of ToaruOS and is released under the terms
|
||||
* of the NCSA / University of Illinois License - see LICENSE.md
|
||||
* Copyright (C) 2021 K. Lange
|
||||
*/
|
||||
#include <stdint.h>
|
||||
#include "options.h"
|
||||
#include "text.h"
|
||||
|
17
boot/kbd.c
17
boot/kbd.c
@ -1,3 +1,20 @@
|
||||
/**
|
||||
* @brief Keyboard reading functions.
|
||||
*
|
||||
* Abstracts away the differences between our EFI and BIOS
|
||||
* environments to provide consistent scancode feedback for
|
||||
* the menus and command line editor.
|
||||
*
|
||||
* For EFI, we use the WaitForKey and ReadKeyStroke interfaces.
|
||||
*
|
||||
* For BIOS, we have a bad PS/2 driver, which should be fine if
|
||||
* you're booting with BIOS?
|
||||
*
|
||||
* @copyright
|
||||
* This file is part of ToaruOS and is released under the terms
|
||||
* of the NCSA / University of Illinois License - see LICENSE.md
|
||||
* Copyright (C) 2021 K. Lange
|
||||
*/
|
||||
#include "kbd.h"
|
||||
#include "util.h"
|
||||
#include "text.h"
|
||||
|
10
boot/menu.c
10
boot/menu.c
@ -1,3 +1,13 @@
|
||||
/**
|
||||
* @brief Present configuration menus.
|
||||
*
|
||||
* Handles display and user interaction for the config menu.
|
||||
*
|
||||
* @copyright
|
||||
* This file is part of ToaruOS and is released under the terms
|
||||
* of the NCSA / University of Illinois License - see LICENSE.md
|
||||
* Copyright (C) 2018-2021 K. Lange
|
||||
*/
|
||||
#include "options.h"
|
||||
#include "text.h"
|
||||
#include "util.h"
|
||||
|
@ -1,3 +1,15 @@
|
||||
/**
|
||||
* @brief Main bootloader logic.
|
||||
*
|
||||
* Does all the heavy lifting after configuration options have
|
||||
* been selected by the user. Loads the kernel and ramdisk,
|
||||
* sets up multiboot structures, and jumps to the kernel.
|
||||
*
|
||||
* @copyright
|
||||
* This file is part of ToaruOS and is released under the terms
|
||||
* of the NCSA / University of Illinois License - see LICENSE.md
|
||||
* Copyright (C) 2018-2021 K. Lange
|
||||
*/
|
||||
#include <stdint.h>
|
||||
#include <stddef.h>
|
||||
#include "multiboot.h"
|
||||
|
@ -1,3 +1,15 @@
|
||||
/**
|
||||
* @brief Some platform-specific abstractions.
|
||||
*
|
||||
* Things like initial entry point, utility functions we need
|
||||
* in BIOS but don't already have, BIOS trampoline management,
|
||||
* and so on.
|
||||
*
|
||||
* @copyright
|
||||
* This file is part of ToaruOS and is released under the terms
|
||||
* of the NCSA / University of Illinois License - see LICENSE.md
|
||||
* Copyright (C) 2018-2021 K. Lange
|
||||
*/
|
||||
extern int kmain();
|
||||
|
||||
#ifdef EFI_PLATFORM
|
||||
|
15
boot/qemu.c
15
boot/qemu.c
@ -1,3 +1,18 @@
|
||||
/**
|
||||
* @brief Detects if we were booted with QEMU and processes fwcfg.
|
||||
*
|
||||
* Determines if we're running in QEMU and looks for "fw_cfg" values
|
||||
* that can override the boot mode.
|
||||
*
|
||||
* TODO This should be perfectly capable of passing a full command
|
||||
* line through the fw_cfg interface, but right now we just look
|
||||
* at some bootmode strings...
|
||||
*
|
||||
* @copyright
|
||||
* This file is part of ToaruOS and is released under the terms
|
||||
* of the NCSA / University of Illinois License - see LICENSE.md
|
||||
* Copyright (C) 2018-2021 K. Lange
|
||||
*/
|
||||
#include <stdint.h>
|
||||
#include "util.h"
|
||||
#include "menu.h"
|
||||
|
15
boot/text.c
15
boot/text.c
@ -1,3 +1,18 @@
|
||||
/**
|
||||
* @brief Abstractions for text output.
|
||||
*
|
||||
* Tries to provide a common interface to text output for
|
||||
* EFI framebuffer, BIOS VESA framebuffer, and BIOS VGA text mode.
|
||||
*
|
||||
* I don't know why I haven't added a full printf to this.
|
||||
*
|
||||
* A lot of this could be rewritten...
|
||||
*
|
||||
* @copyright
|
||||
* This file is part of ToaruOS and is released under the terms
|
||||
* of the NCSA / University of Illinois License - see LICENSE.md
|
||||
* Copyright (C) 2018-2021 K. Lange
|
||||
*/
|
||||
#include "text.h"
|
||||
#include "util.h"
|
||||
int txt_debug = 0;
|
||||
|
18
boot/util.c
18
boot/util.c
@ -1,3 +1,13 @@
|
||||
/**
|
||||
* @brief Utility functions.
|
||||
*
|
||||
* Kind of a barebones libc.
|
||||
*
|
||||
* @copyright
|
||||
* This file is part of ToaruOS and is released under the terms
|
||||
* of the NCSA / University of Illinois License - see LICENSE.md
|
||||
* Copyright (C) 2018-2021 K. Lange
|
||||
*/
|
||||
#include "util.h"
|
||||
|
||||
int strcmp(const char * l, const char * r) {
|
||||
@ -38,11 +48,3 @@ char * strcat(char *dest, const char *src) {
|
||||
return dest;
|
||||
}
|
||||
|
||||
void copy_sectors(unsigned long lba, unsigned char * buf, int sectors) {
|
||||
memcpy(buf, (char*)(lba * 2048 + DATA_LOAD_BASE), sectors * 2048);
|
||||
}
|
||||
|
||||
void copy_sector(unsigned long lba, unsigned char * buf) {
|
||||
memcpy(buf, (char*)(lba * 2048 + DATA_LOAD_BASE), 2048);
|
||||
}
|
||||
|
||||
|
12
boot/video.c
12
boot/video.c
@ -1,3 +1,15 @@
|
||||
/**
|
||||
* @brief Video mode management.
|
||||
*
|
||||
* Tries to abstract away differences between VESA mode setting
|
||||
* on BIOS and GOP mode setting on UEFI. Also provides the
|
||||
* video mode selection menu.
|
||||
*
|
||||
* @copyright
|
||||
* This file is part of ToaruOS and is released under the terms
|
||||
* of the NCSA / University of Illinois License - see LICENSE.md
|
||||
* Copyright (C) 2018-2021 K. Lange
|
||||
*/
|
||||
#include "text.h"
|
||||
#include "util.h"
|
||||
#include "kbd.h"
|
||||
|
Loading…
Reference in New Issue
Block a user