The manual
ginnOS
The reference: libc, the libraries and the kernel
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
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 */
17void 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 */
23bool 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 */
31bool cmdline_get_uint(const char *key, uint32_t *value);
void cmdline_init(const boot_info_t *boot)
keep a copy of the command line of the bootloader.
Definition cmdline.c:16
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
bool cmdline_has(const char *flag)
true if the command line has this word as a flag.
Definition cmdline.c:67
unsigned int uint32_t
Definition fb.h:17
information the bootloader hands to the kernel.
Definition boot_info.h:21