The manual
ginnOS
The reference: libc, the libraries and the kernel
Loading...
Searching...
No Matches
cmdline.h File Reference

the kernel command line that the bootloader gives: words split by spaces, each a flag ("nosmp") or a key and a value ("maxcpus=2"). More...

Go to the source code of this file.

Functions

void cmdline_init (const boot_info_t *boot)
 keep a copy of the command line of the bootloader.
bool cmdline_has (const char *flag)
 true if the command line has this word as a flag.
bool cmdline_get_uint (const char *key, uint32_t *value)
 read the value of "key=N" from the command line, as a decimal number.

Detailed Description

the kernel command line that the bootloader gives: words split by spaces, each a flag ("nosmp") or a key and a value ("maxcpus=2").

Function Documentation

◆ cmdline_init()

void cmdline_init ( const boot_info_t * boot)

keep a copy of the command line of the bootloader.

call it once at boot, after paging_init (the line is read through the direct map).

Parameters
bootthe boot information; cmdline_addr 0 means no line.

◆ cmdline_has()

bool cmdline_has ( const char * flag)

true if the command line has this word as a flag.

Parameters
flagthe word, for example "nosmp".

◆ 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.

Parameters
keythe key, for example "maxcpus".
valuereceives the number if the key is there with a number.
Returns
true if value was set.