The manual
ginnOS
The reference: libc, the libraries and the kernel
Toggle main menu visibility
Loading...
Searching...
No Matches
cmdline.h
Go to the documentation of this file.
1
#pragma once
2
3
/**
4
* @file cmdline.h
5
* @brief the kernel command line that the bootloader gives: words split by
6
* spaces, each a flag ("nosmp") or a key and a value ("maxcpus=2").
7
*/
8
9
#include "
common/boot/boot_info.h
"
10
#include "
common/stdint.h
"
11
12
/**
13
* keep a copy of the command line of the bootloader. call it once at boot,
14
* after paging_init (the line is read through the direct map).
15
* @param boot the boot information; cmdline_addr 0 means no line.
16
*/
17
void
cmdline_init
(
const
boot_info_t
*boot);
18
19
/**
20
* true if the command line has this word as a flag.
21
* @param flag the word, for example "nosmp".
22
*/
23
bool
cmdline_has
(
const
char
*flag);
24
25
/**
26
* read the value of "key=N" from the command line, as a decimal number.
27
* @param key the key, for example "maxcpus".
28
* @param value receives the number if the key is there with a number.
29
* @return true if value was set.
30
*/
31
bool
cmdline_get_uint
(
const
char
*key,
uint32_t
*value);
boot_info.h
cmdline_init
void cmdline_init(const boot_info_t *boot)
keep a copy of the command line of the bootloader.
Definition
cmdline.c:16
cmdline_get_uint
bool cmdline_get_uint(const char *key, uint32_t *value)
read the value of "key=N" from the command line, as a decimal number.
Definition
cmdline.c:83
cmdline_has
bool cmdline_has(const char *flag)
true if the command line has this word as a flag.
Definition
cmdline.c:67
stdint.h
uint32_t
unsigned int uint32_t
Definition
fb.h:17
boot_info_t
information the bootloader hands to the kernel.
Definition
boot_info.h:21
src
kernel
cmdline.h
Generated by
1.18.0