mirror of
https://github.com/memtest86plus/memtest86plus.git
synced 2025-02-25 18:55:23 -06:00
Add support for boot command line options.
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
* the Linux boot_params struct, although we only define the fields we are
|
||||
* interested in.
|
||||
*
|
||||
* Copyright (C) 2020 Martin Whitaker.
|
||||
* Copyright (C) 2020-2021 Martin Whitaker.
|
||||
*/
|
||||
|
||||
#include <stdint.h>
|
||||
@@ -94,9 +94,13 @@ typedef struct {
|
||||
uint8_t e820_entries;
|
||||
uint8_t unused4[0x214 - 0x1e9];
|
||||
uint32_t code32_start;
|
||||
uint8_t unused5[0x2d0 - 0x218];
|
||||
uint8_t unused5[0x228 - 0x218];
|
||||
uint32_t cmd_line_ptr;
|
||||
uint8_t unused6[0x238 - 0x22c];
|
||||
uint32_t cmd_line_size;
|
||||
uint8_t unused7[0x2d0 - 0x23c];
|
||||
e820_entry_t e820_map[E820_MAP_SIZE];
|
||||
uint8_t unused6[0xeec - 0xd00];
|
||||
uint8_t unused8[0xeec - 0xd00];
|
||||
} __attribute__((packed)) boot_params_t;
|
||||
|
||||
#endif /* BOOTPARAMS_H */
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
// boot_params struct. A pointer to this block is passed to the main program,
|
||||
// for compatiblity with the Linux 32-bit boot protocol.
|
||||
//
|
||||
// Copyright (C) 2020 Martin Whitaker.
|
||||
// Copyright (C) 2020-2021 Martin Whitaker.
|
||||
//
|
||||
// Derived from memtest86+ setup.S and head.S:
|
||||
//
|
||||
@@ -162,6 +162,13 @@ do_setup:
|
||||
|
||||
movl %eax, (BOOT_PARAMS_START + 0x214)
|
||||
|
||||
# Copy cmd_line_ptr and cmd_line_size to the boot_params struct.
|
||||
|
||||
movl (cmd_line_ptr - setup), %eax
|
||||
movl %eax, (BOOT_PARAMS_START + 0x228)
|
||||
movl (cmd_line_size - setup), %eax
|
||||
movl %eax, (BOOT_PARAMS_START + 0x238)
|
||||
|
||||
# Switch to protected mode.
|
||||
|
||||
movl %cr0, %eax
|
||||
|
||||
Reference in New Issue
Block a user