Skip to content

Agent KB_root

grisun0 edited this page Oct 23, 2026 · 11 revisions

Subsystem: root

bootloader.c

  • Layer: utility
  • Language: c
  • Symbols:
    • main (function, line 21) void main(void)
    • KSECTORS (macro, line 19) #define KSECTORS

kernel.c

  • Doc: Mediator: boot orchestration and the syscall trampoline.
  • Layer: utility
  • Language: c
  • Symbols:
    • syscall_init (function, line 117) void syscall_init(void)
    • bootlog_mark (function, line 192) void bootlog_mark(const char *name)
    • bootlog_report (function, line 199) void bootlog_report(void)
    • __attribute__ (function, line 207) __attribute__((section(".init.text"))) void kmain(void)
    • tables (function, line 279) `* tables (already built above) for its uncached register window and the
      • heap for its rings...`
    • table (function, line 104) * Symbol table (for resolving program references) * ================================================================...
    • ksyscall (function, line 130) extern long ksyscall(long n, long a1, long a2, long a3, long a4, long a5, long a6);
    • kstack (function, line 146) * Reading gs:8 instead resolves every thread to the wrong kstack (0 on * the BSP, 1 on APs): harmless while a single...
    • ms (function, line 185) * 0 ms (TSC ticks since power-on divided down, still monotonic);
    • size (function, line 257) * image size (see kernel.ld);
    • syscall_kstack (variable, line 115) extern unsigned long syscall_kstack;
    • ramdisk_start (variable, line 179) extern char ramdisk_start[];
    • ramdisk_end (variable, line 180) extern char ramdisk_end[];
    • KSYM_MAX (macro, line 107) #define KSYM_MAX
    • BOOTLOG_MAX (macro, line 188) #define BOOTLOG_MAX
  • Depends on: headers/abi.h, headers/arch/x86/boot/bootdefs.h, headers/arch/x86/cpu_setup.h, headers/arch/x86/msr.h, headers/block.h, headers/drivers/usbblk.h, headers/drivers/usbhid.h, headers/drivers/virtio_blk.h, headers/drivers/xhci.h, headers/ide.h, headers/minifs.h, headers/net.h, headers/pcache.h, headers/sb16.h, headers/sched.h, headers/smp.h, headers/syscall_asm.h, headers/vga_fb.h

qga.c

  • Doc: MiniOS QEMU guest agent (QGA).
  • Layer: utility
  • Language: c
  • Symbols:
    • qga_pair (struct, line 49)
    • qga_tx_ready (function, line 27) static int qga_tx_ready(void)
    • qga_rx_ready (function, line 28) static int qga_rx_ready(void)
    • qga_putc (function, line 30) static void qga_putc(char c)
    • qga_init (function, line 35) void qga_init(void)
    • qga_ws (function, line 56) static int qga_ws(char c)
    • qga_parse_object (function, line 65) static int qga_parse_object(const char **pp, struct qga_pair *out, int max, ...
    • qga_parse_flat (function, line 147) static int qga_parse_flat(const char *s, struct qga_pair *out, int max)
    • qga_get_str (function, line 158) static const char *qga_get_str(const struct qga_pair *pairs, int n, const char *key)
    • qga_get_int (function, line 166) static int qga_get_int(const struct qga_pair *pairs, int n, const char *key, long *out)
    • qga_resp_reset (function, line 184) static void qga_resp_reset(void)
    • qga_resp_puts (function, line 186) static void qga_resp_puts(const char *s)
    • qga_resp_putc_enc (function, line 194) static void qga_resp_putc_enc(char c)
    • qga_resp_put_long (function, line 201) static void qga_resp_put_long(long v)
    • qga_err (function, line 210) static void qga_err(const char *klass, const char *desc)
    • qga_puts_resp (function, line 218) static void qga_puts_resp(void)
    • qga_b64_encode (function, line 231) static void qga_b64_encode(const unsigned char *in, int n)
    • qga_cmd_get_time (function, line 281) static void qga_cmd_get_time(void)
    • qga_cmd_exec (function, line 306) static void qga_cmd_exec(const struct qga_pair *pairs, int n)
    • qga_cmd_shutdown (function, line 316) static void qga_cmd_shutdown(const struct qga_pair *pairs, int n)
    • qga_file_size (function, line 329) static int qga_file_size(const KFILE *f)
    • qga_cmd_file_open (function, line 334) static void qga_cmd_file_open(const struct qga_pair *pairs, int n)
    • qga_cmd_file_read (function, line 360) static void qga_cmd_file_read(const struct qga_pair *pairs, int n)
    • qga_cmd_file_close (function, line 384) static void qga_cmd_file_close(const struct qga_pair *pairs, int n)
    • qga_dispatch (function, line 401) static void qga_dispatch(struct qga_pair *pairs, int n)
    • qga_poll (function, line 446) void qga_poll(void)
    • channel (function, line 10) * * Polled channel (no interrupt controller): qga_init sets up COM2 and * qga_poll, called from raw_blocking_getc...
  • Depends on: headers/qga.h, headers/rtc.h

smp.c

  • Doc: SMP application-processor bring-up.
  • Layer: utility
  • Language: c
  • Symbols:
    • lapic_read (function, line 88) static unsigned lapic_read(unsigned off)
    • lapic_write (function, line 91) static void lapic_write(unsigned off, unsigned val)
    • smp_nmi_broadcast (function, line 113) void smp_nmi_broadcast(void)
    • map_lapic (function, line 128) static int map_lapic(void)
    • ap_delay (function, line 141) static void ap_delay(void)
    • lapic_calibrate (function, line 170) static void lapic_calibrate(void)
    • ap_lapic_timer_start (function, line 204) static void ap_lapic_timer_start(void)
    • ap_lapic_timer_init (function, line 210) static void ap_lapic_timer_init(void)
    • smp_init (function, line 341) void smp_init(void)
    • syscall_entry (function, line 86) extern void syscall_entry(void);
    • BSP (function, line 258) * were programmed only on the BSP (syscall_init runs in kmain), so * an AP's first sysretq loaded SS from a zeroed...
    • routine (function, line 286) * routine (FreeDom's fetch threads, under -smp 2). */ cpu_enable_caches();
    • INIT (function, line 359) * INIT (edge-triggered): resets APs to wait-for-SIPI state. * QEMU 11 drops level-triggered INIT (delivery status...
    • LAPIC_BASE (macro, line 29) #define LAPIC_BASE
    • LAPIC_ID_OFF (macro, line 30) #define LAPIC_ID_OFF
    • LAPIC_SVR_OFF (macro, line 31) #define LAPIC_SVR_OFF
    • LAPIC_ICR_HI (macro, line 32) #define LAPIC_ICR_HI
    • LAPIC_ICR_LO (macro, line 33) #define LAPIC_ICR_LO
    • LAPIC_LVT_TIMER (macro, line 34) #define LAPIC_LVT_TIMER
    • LAPIC_LVT_LINT0 (macro, line 35) #define LAPIC_LVT_LINT0
    • LAPIC_LVT_LINT1 (macro, line 36) #define LAPIC_LVT_LINT1
    • LAPIC_LVT_MASKED (macro, line 37) #define LAPIC_LVT_MASKED
    • LAPIC_LVT_EXTINT (macro, line 38) #define LAPIC_LVT_EXTINT
    • LAPIC_EOI_OFF (macro, line 39) #define LAPIC_EOI_OFF
    • LAPIC_TIMER_DIV (macro, line 40) #define LAPIC_TIMER_DIV
    • LAPIC_TIMER_INIT (macro, line 41) #define LAPIC_TIMER_INIT
    • LAPIC_TIMER_CUR (macro, line 42) #define LAPIC_TIMER_CUR
    • LAPIC_SVR_ENABLE (macro, line 44) #define LAPIC_SVR_ENABLE
    • LAPIC_ICR_BUSY (macro, line 45) #define LAPIC_ICR_BUSY
    • LAPIC_ICR_INIT (macro, line 46) #define LAPIC_ICR_INIT
    • LAPIC_ICR_SIPI (macro, line 47) #define LAPIC_ICR_SIPI
    • LAPIC_ICR_ALL_EXC (macro, line 48) #define LAPIC_ICR_ALL_EXC
    • LAPIC_ICR_LEVEL (macro, line 49) #define LAPIC_ICR_LEVEL
    • LAPIC_ICR_TRIGGER (macro, line 50) #define LAPIC_ICR_TRIGGER
    • LAPIC_ICR_NMI (macro, line 51) #define LAPIC_ICR_NMI
    • LAPIC_ICR_IDLE_SPINS (macro, line 53) #define LAPIC_ICR_IDLE_SPINS
    • SIPI_VECTOR (macro, line 55) #define SIPI_VECTOR
    • PIT_HZ (macro, line 58) #define PIT_HZ
    • LAPIC_TIMER_DIVIDE_16 (macro, line 61) #define LAPIC_TIMER_DIVIDE_16
    • LAPIC_TIMER_PERIODIC (macro, line 62) #define LAPIC_TIMER_PERIODIC
    • LAPIC_PD_ADDR (macro, line 70) #define LAPIC_PD_ADDR
    • LAPIC_PDPT_SLOT (macro, line 71) #define LAPIC_PDPT_SLOT
    • LAPIC_PD_IDX (macro, line 72) #define LAPIC_PD_IDX
  • Depends on: headers/ap_stub.h, headers/arch/x86/boot/bootdefs.h, headers/arch/x86/cpu_setup.h, headers/arch/x86/msr.h, headers/sched.h, headers/smp.h

tls_test.c

  • Doc: host-side tests for the kernel TLS stack.
  • Layer: testing
  • Language: c
  • Symbols:
    • tls_test_send (function, line 26) int tls_test_send(int fd, const char *buf, int len)
    • tls_test_recv (function, line 36) int tls_test_recv(int fd, char *buf, int len)
    • tls_test_recv_timeout (function, line 41) int tls_test_recv_timeout(int fd, char *buf, int len, unsigned long ms)
    • tls_test_close (function, line 54) void tls_test_close(int fd)
    • hexdigit (function, line 67) static int hexdigit(int c)
    • unhex (function, line 74) static void unhex(const char *hex, unsigned char *out, int n)
    • bytes_eq (function, line 80) static int bytes_eq(const unsigned char *a, const unsigned char *b, int n)
    • test_sha256 (function, line 88) static void test_sha256(void)
    • test_sha384 (function, line 103) static void test_sha384(void)
    • test_gcm (function, line 114) static void test_gcm(void)
    • test_p256 (function, line 154) static void test_p256(void)
    • test_rsa_ecdsa_vectors (function, line 200) static void test_rsa_ecdsa_vectors(void)
    • tcp_connect (function, line 249) static int tcp_connect(int port)
    • http_over_tls (function, line 265) static int http_over_tls(int port, const char *host)
    • scenario_good (function, line 290) static int scenario_good(int port)
    • scenario_wild_good (function, line 295) static int scenario_wild_good(int port)
    • scenario_wild_root (function, line 299) static int scenario_wild_root(int port)
    • scenario_wild_deep (function, line 309) static int scenario_wild_deep(int port)
    • scenario_bad_host (function, line 319) static int scenario_bad_host(int port)
    • scenario_bad_ca (function, line 329) static int scenario_bad_ca(int port)
    • scenario_expired (function, line 339) static int scenario_expired(int port)
    • main (function, line 349) int main(int argc, char **argv)
    • CHECK (macro, line 62) #define CHECK(name, cond)
  • Depends on: headers/tls.h, headers/tls_port.h, kernel/string.c

vma.c

  • Doc: vma_node_in_tree: 1 when node n hangs in the tree rooted at root (live and free trees * share...
  • Layer: utility
  • Language: c
  • Symbols:
    • vma_ctx_init (function, line 37) void vma_ctx_init(vma_ctx_t *c, vma_node_t *pool)
    • vma_ctx_bind (function, line 52) void vma_ctx_bind(vma_ctx_t *c)
    • vma_ctx_save (function, line 64) void vma_ctx_save(vma_ctx_t *c)
    • vma_view_save (function, line 74) void vma_view_save(vma_view_t *v)
    • vma_view_load (function, line 86) void vma_view_load(const vma_view_t *v)
    • vma_tree_init (function, line 98) void vma_tree_init(void)
    • vma_alloc_node (function, line 113) static vma_node_t *vma_alloc_node(void)
    • vma_rotate_left (function, line 124) static void vma_rotate_left(vma_node_t **root, vma_node_t *x)
    • vma_rotate_right (function, line 136) static void vma_rotate_right(vma_node_t **root, vma_node_t *x)
    • vma_insert_fixup (function, line 148) static void vma_insert_fixup(vma_node_t **root, vma_node_t *z)
    • vma_tree_insert (function, line 187) vma_node_t *vma_tree_insert(vma_node_t **root, unsigned long base, unsigned long len)
    • vma_node_in_tree (function, line 215) static int vma_node_in_tree(vma_node_t *root, vma_node_t *n)
    • vma_tree_find (function, line 220) vma_node_t *vma_tree_find(vma_node_t *root, unsigned long base)
    • vma_tree_find_containing (function, line 238) vma_node_t *vma_tree_find_containing(vma_node_t *root, unsigned long va)
    • vma_transplant (function, line 252) static void vma_transplant(vma_node_t **root, vma_node_t *u, vma_node_t *v)
    • vma_tree_minimum (function, line 259) static vma_node_t *vma_tree_minimum(vma_node_t *x)
    • vma_delete_fixup (function, line 264) static void vma_delete_fixup(vma_node_t **root, vma_node_t *x)
    • vma_tree_delete (function, line 319) int vma_tree_delete(vma_node_t **root, unsigned long base)
  • Depends on: headers/vma.h

Start

Wiki

Agent Docs

Recipes

Clone this wiki locally