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

the kernel command line (cmdline.h). More...

#include "kernel/cmdline.h"
#include "common/string.h"
#include "kernel/klog/klog.h"
#include "kernel/memory/phys.h"

Macros

#define CMDLINE_MAX   256

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 (cmdline.h).

Macro Definition Documentation

◆ CMDLINE_MAX

#define CMDLINE_MAX   256

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.