Skip to content

Interfaces Reference EN

Z User edited this page Oct 24, 2026 · 2 revisions

Language: English | Interfaces-Reference

 Do not hand-edit the tables; edit the generator or the
 surface headers instead. -->

Open Cube OS Interface Reference

Every entry below is extracted from the real tree at generation time: the shell command table from a live help -a runtime capture, the interface declarations straight from the surface headers. Regenerate with make api-docs.

  • Shell commands (runtime authority): 233
  • L1 extension interfaces (numbered surface, the README formula 57+8+13+7+26+11+7+9+8+16): 162
  • Callable declarations across the 13 surface headers (includes internal helpers and unnumbered items): 278
  • Syscalls: 53 (grep -c '#define SYS_' kernel/core/core_syscall.h)
  • Source lines: 140,672 across 353 files (README verification command; .c/.h/.S, generated data blobs excluded)

Part 1 - Shell commands (233)

From the runtime help -a capture (evidence/help_a_runtime.txt).

Command One-line help
ab_partition_test A/B disk discovery + slots + flags (WP-10u)
abcfg show the grub.cfg files abdisk/install write
abdisk create a bootable A/B update disk (abdisk <dev>; destroys data)
ac97 AC'97 status
ac97_test AC'97 init/play test
acpi dump ACPI tables (RSDP/FADT/DSDT/MCFG)
acpidev list ACPI namespace devices (AML)
acpipow ACPI power status (S1-S5/SCI/GPE/FACS)
acpitest AML interpreter self-test + DSDT checks
ahci AHCI controller/port status
ahci_test WP-10a: AHCI init/ports/read-write test
alias set/show aliases
arp show ARP cache
ata ATA (PIO + Bus-Master DMA) status
ata_dma_test WP-10a: ATA Bus-Master DMA test + PIO timing
audio_rw_test play/stop round-trip on every card
bcm57xx BCM57xx NIC status
bcm57xx_test WP-10b: BCM57xx presence/link/send-recv test
bt bluetooth: status/usb/uart/test (HCI/L2CAP/RFCOMM/SDP/SPP/HID)
cat print file contents (cat <file>)
cd change directory (cd [path])
checkupdate check for updates via /etc/opencube.conf (http/https)
checkupdate_test update check self-test (URL/JSON units + live probe)
chinese chinese support status (font/encoding/render/ime)
chinesetest run the full Chinese support regression suite
clear clear screen
config read/write system config (config list|get|set|restore|path)
config_test config subsystem self-test (write/read/get_all/delete/restore)
cp copy file (cp <src> <dst>)
cr3test test CR3 switching
crashlog show last exception crashes
crashtest trigger kernel crash tests (panic/exc/pf/assert/wd/dump/policy)
cryptotest test AES/SHA-256/HMAC with NIST vectors
df show disk/mount usage
dhcp get IP via DHCP
dhtest DH modexp 1024-bit (Oakley Group 1) timing + correctness
disk_rw_test WP-10a: rw round-trip on one device (disk_rw_test <dev>)
dmesg show the kernel log ring (dmesg [N])
dns resolve domain name (dns <name> [aaaa|cname|mx|txt|ns|srv])
dnstest DNS record-type self-test (A/AAAA/MX/TXT/NS/SRV live)
dskstat show block devices
du directory usage (du [path])
dumpinfo show core dump status (size/persisted/header)
e1000e e1000e NIC status
e1000e_test WP-10b: e1000e init/link/send-recv test
echo echo the text back
edit line editor (edit <file>; :i :d :p :w :q :wq)
encoding encoding codec status (gb2312/utf-8/ascii)
encoding-test quick codec round-trip check (full: chinesetest)
es1370 ES1370/1371 status
es1370_test ES1370 init/play test
exc run exception self-test (#DE/#UD/#PF)
export set env var (export NAME=value)
fatmount mount FAT32 (fatmount <dev> <path>)
fatstat show FAT32 stats
firewall show/add/del firewall rules (chains, states, policies, conntrack)
font list registered fonts and the active renderer
font-test render a mixed CJK/ASCII sample row on the console
frag show memory fragmentation
fs_mount_test WP-10a: mkfs+mount FAT32 file round-trip (fs_mount_test <dev>)
fsck filesystem check
fstest run VFS self-test (mkdir/write/read/ls)
gameport game port status (axes, buttons, calibration)
gameporttest game port self test (axis reads, buttons, calibration)
grep filter lines matching pattern (grep <pattern> [file])
grub-install write the GRUB BIOS boot loader (grub-install <dev>)
halt halt the kernel
halt_test verify halt path (live halt via 'halt')
hda Intel HDA status
hda_test Intel HDA init/codec/play test
health system health monitor (health [watch|export])
health export write health JSON to /var/log/health.json
health watch live health monitor, 1 s refresh (ENTER exits)
heap show kernel heap stats
heapbounds heap bounds regression (BUG-0140 wrap / BUG-0141 ceiling)
heaptest test heap overhead with 100 allocs
help show this message
help_a_test verify help -a A-Z ordering
help_default_test verify default help A-Z ordering
help_wp_test verify help -w group ordering
hpet HPET: caps + counter + one-shot/periodic IRQ8 tests
i2cdetect scan I2C/SMBus buses for devices
i2cget read I2C byte (i2cget <bus> <addr> [reg])
i2cset write I2C byte (i2cset <bus> <addr> <reg> <val>)
i2ctest I2C core/controller self-test
ifconfig show network interface info
igb igb NIC status
igb_test WP-10b: igb init/link/send-recv test
ime pinyin IME status; "ime -i" opens the interactive console line
ime-test quick IME syllable resolution check
install install the running system to a disk (install <dev>; destroys data)
ip show/set IP address
ir infrared status (CIR/SIR devices, carrier, counters)
irqabitest IRQ-entry ABI regression (BUG-0137 align / BUG-0138 DF)
irtest infrared self test (NEC/RC5/RC6/SIRC round trips)
ixgbe ixgbe NIC status
ixgbe_test WP-10b: ixgbe presence/link/send-recv test
kill kill a task (kill <tid>)
l1test test L1 job_create/job_list/job_control with running process
lang show or set the shell output language (lang [en|zh])
ldd list dynamic dependencies (ldd <program>)
logcat filter the kernel log (logcat -l lvl -m mod -k key -t sec -n N [-f])
logctl control the kernel log (logctl status|level|enable|disable|clear|flush|rotate|e
ls list directory (ls [path])
lsblk list block devices
lspci list PCI devices
mem show physical memory stats
memtest run memory test (PMM + heap)
mkdir make directory (mkdir <path>)
mkfs.exfat format exFAT (mkfs.exfat <dev> confirm)
mkfs.ext4 format ext4 (mkfs.ext4 <dev> confirm)
mkfs.fat32 format FAT32 (mkfs.fat32 <dev> confirm)
mount list mounts, or mount a fs: mount <type> <device> <path>
mounts list VFS mount table (alias for mount)
msitest LAPIC self-IPI + MSI/MSI-X device fire test
multi spawn 3 tasks with interleaved output
mv move/rename file (mv <src> <dst>)
nano nano-style editor (nano <file>; ^O save ^X exit)
netstat show network statistics and sockets
nf_test netfilter self-test (rules, conntrack, policies, real-path)
nic_rw_test WP-10b: send/recv correctness on all NICs
nice change priority (nice <tid> <prio>)
nvme NVMe controller/queue status
nvme_test WP-10a: NVMe init/queues/read-write test
other_nic_test WP-10b: legacy NICs (3c59x/nForce/AR81xx/Yukon)
parallel parallel port status (IEEE 1284 modes, counters)
paralleltest parallel self test (SPP write, EPP cycles, ECP probe)
parted show partition table (parted [dev])
partition_test WP-10a: MBR+GPT parse test (partition_test [dev])
pcibars list PCI devices with sized BARs
pcidump dump PCI config space (pcidump <b:d.f>)
pcie PCIe MMCONFIG state + capability walk
pftest test page fault handling
ping send ICMP echo (ping <host>)
play play a test tone (play [rate])
pmmrace BUG-0043 repro: PMM bitmap race thread-vs-IRQ
pmtimer ACPI PM timer: read + PIT calibration + wrap tests
poweroff alias of shutdown
poweroff_test real power-off attempt (QEMU exits)
ps list all tasks
pwd print working directory
real_hw_test WP-10a: real-hardware detection report
real_update_test end-to-end update phase 1 (WP-10u)
reboot reboot the machine (reboot)
reboot_test verify reboot path (live reset via 'reboot')
rm delete file (rm <file>)
rmdir remove directory (rmdir <path>)
rollback roll back to slot A (rollback)
route show/add/del routing table (route add <dst> <mask> <gw>)
rtc CMOS RTC: time + status + UIE/PIE/alarm interrupt tests
rtl810x RTL810x NIC status
rtl810x_test WP-10b: RTL810x presence/link/send-recv test
rtl8125 RTL8125 NIC status
rtl8125_test WP-10b: RTL8125 presence/link/send-recv test
rtl8139 RTL8139 NIC status
rtl8139_test WP-10b: RTL8139 init/link/send-recv test
rtl8168 RTL8168 NIC status
rtl8168_test WP-10b: RTL8168 presence/link/send-recv test
run run a user program (hello/badapp/loop/fork_test/.../dyn_test/so_test/dyn_hello/
sample_rate_test 44100/48000 rate configuration test
sb16 Sound Blaster 16 status
sb16_test SB16 init/play test
sched show scheduler stats
scsi SCSI status (HBAs, targets, capacity, blk names)
scsitest SCSI self test (CDB goldens, parsers, live target)
set list env vars
shutdown power off (flush + ACPI/Bochs/APM ports)
sleep delay for N seconds (sleep <sec>)
smbus list SMBus devices from the scan
smbustest SMBus protocol test (byte/word/block)
sound list registered sound cards
spawn spawn a test kernel thread
ssh SSH client connect (ssh <ip> [port] [user] [password])
sshd SSH server (sshd [port=22] [user=oc] [password=oc])
stats show interrupt/timer stats
sync flush disk cache
syncstat show sync primitive stats
synctest test sync primitives (spinlock/mutex/sem)
tcpcc_test CUBIC congestion control self-test vectors
tcpstats show TCP reliability stats (cwnd, rto, etc.)
tcptest TCP option negotiation self-test (MSS/WScale/SACK/TS live)
timer register a 500ms one-shot timer
touch create empty file (touch <path>)
touchpad touchpad status + pending gesture events
touchtest multitouch pipeline self-test (tap/scroll/pinch/swipe)
tree tree view of directory (tree [path])
tsc TSC: reads + PIT/HPET/PMTimer calibration + delay test
tui full-screen TUI main menu (arrows/Tab/Enter/Esc)
tui-drv driver setup TUI (alias of tui-hw; page name optional)
tui-ext TUI L1 extension lab: selftest + registries
tui-hw hardware configuration TUI (optional: page name)
tui-net wireless network TUI (WiFi + Bluetooth)
tui-sys system settings TUI (host/net/storage/user/security/update/log/tui)
tui-sysinfo system information TUI (optional: page name)
tui-test run the TUI self-test suite (input/expected/actual/verdict)
tui-time time TUI: clock/sources/set RTC/timezone
umount unmount (umount <path>)
unalias remove an alias
uname print OS name (uname [-a|-s|-r|-m])
update check + install system update (update [local <pkg> | --local <pkg> | --status])
update_check_test update manifest check with package fields (WP-10u)
update_download_test download the update package (WP-10u)
update_install_test install the package into slot B (WP-10u)
update_local_test offline update flow via cmd_update --local (WP-10u)
update_pkg_test gzip/DEFLATE + tar unit tests (WP-10u)
update_rollback_test boot flags + rollback (WP-10u)
update_status_test ota_update_get_status coverage (WP-10u)
update_verify_test SHA256 verification of the package (WP-10u)
usb USB hosts/devices + class driver status
usb_audio_test USB audio init/play test
usb_core_test USB core invariants + live transfers
usb_hotplug_test USB hot-plug (usb_hotplug_test [wait-new N|wait-leave N])
usb_hub_test USB external hub + children
usb_kbd_test USB HID keyboard presence + injection
usb_mouse_test USB HID mouse presence + event drain
usb_serial_test USB serial TX/RX round
usb_storage_test USB MSC drive capacity/rw/partitions
usbaudio USB audio status
usbdev USB device detail (usbdev [slot])
uvc camera subsystem status (UVC devices, formats, frames)
uvctest camera self test (JPEG decode, UVC descriptor parse, core)
vi vi editor, two-mode (hjkl move, i/a/o insert, ESC, :w :q :wq :q!)
virtio_blk_test WP-10a: virtio-blk capacity + read/write test
virtio_snd_test virtio-snd init/play test
virtiosnd virtio-snd status
vmkernelpt VMM PT-ownership regression (BUG-0136)
vmmap show address space mappings
vmtest run virtual memory test
volume get/set volume (volume [0-100])
watchdog watchdog status/control (hw TCO/WDAT + monitored slots + policy tests)
wget download file via HTTP (wget <host> [port] [path])
wifi wireless: status/scan/test/sdio (802.11 families + SDIO bus)
write write text to file (write <path> <text>)

Part 2 - L1 surface header declarations

Every callable declaration in the 13 L1 surface headers, in file and declaration order. The numbered L1 extension count is 162 (README formula); the tables below are the complete, unfiltered declaration truth of those headers.

drivers/block/driver_block_blk.h

Line Declaration
86 void driver_block_init(void);
89 int driver_block_register_device(const char *name, driver_block_type_t type, u64 sectors, u32 sector_size, const driver_block_ops_t *ops, void *priv);
94 int driver_block_unregister_device(int index);
97 int driver_block_find_device(const char *name);
100 driver_block_device_t *driver_block_get_device(int index);
104 int driver_block_read_sectors(int dev_idx, u64 lba, u32 count, void *buf);
105 int driver_block_write_sectors(int dev_idx, u64 lba, u32 count, const void *buf);
109 int driver_block_read_sectors_raw(int dev_idx, u64 lba, u32 count, void *buf);
110 int driver_block_write_sectors_raw(int dev_idx, u64 lba, u32 count, const void *buf);
133 int driver_block_register(driver_block_device_t *dev, const driver_block_ops_t *ops);
134 int driver_block_read (driver_block_device_t *dev, u64 lba, u32 count, void *buf);
135 int driver_block_write(driver_block_device_t *dev, u64 lba, u32 count, const void *buf);
136 int driver_block_flush(driver_block_device_t *dev);
141 int driver_block_set_ops(int dev_idx, const driver_block_ops_t *ops);
144 void driver_block_list_devices(void);
147 void driver_block_get_stats(int dev_idx, driver_block_stats_t *out);
150 int driver_block_num_devices(void);

drivers/nic/driver_nic.h

Line Declaration
108 void driver_nic_init(void);
111 int driver_nic_register(driver_nic_device_t *dev, const driver_nic_ops_t *ops);
114 int driver_nic_send(driver_nic_device_t *dev, const void *buf, int len);
115 int driver_nic_recv(driver_nic_device_t *dev, void *buf, int maxlen);
118 int driver_nic_link_status(driver_nic_device_t *dev);
121 int driver_nic_get_mac(driver_nic_device_t *dev, u8 mac[6]);
124 int driver_nic_num_devices(void);
125 driver_nic_device_t *driver_nic_get_device(int idx);
126 int driver_nic_find_by_type(driver_nic_type_t type);
127 int driver_nic_find_first_present(void);
128 void driver_nic_list_devices(void);
134 int driver_nic_probe_all(void);
137 driver_nic_device_t *driver_nic_active(void);
140 int driver_nic_e1000e_init(driver_pci_dev_t *pdev);
141 void driver_nic_e1000e_resume(void);
142 int driver_nic_igb_init(driver_pci_dev_t *pdev);
143 int driver_nic_ixgbe_init(driver_pci_dev_t *pdev);
144 int driver_nic_rtl8139_init(driver_pci_dev_t *pdev);
145 int rtl8168_init(driver_pci_dev_t *pdev);
146 int rtl8125_init(driver_pci_dev_t *pdev);
147 int rtl810x_init(driver_pci_dev_t *pdev);
148 int bcm57xx_init(driver_pci_dev_t *pdev);
153 int other_nics_init(driver_pci_dev_t *pdev);
154 void other_nics_print_state(void);
157 void shell_cmds_nic_test_register(void);
160 void driver_nic_e1000e_print_state(void);
161 void driver_nic_igb_print_state(void);
162 void driver_nic_ixgbe_print_state(void);
163 void driver_nic_rtl8139_print_state(void);
164 void rtl8168_print_state(void);
165 void rtl8125_print_state(void);
166 void rtl810x_print_state(void);
167 void bcm57xx_print_state(void);
174 void driver_nic_resume(void);

drivers/snd/driver_snd.h

Line Declaration
149 void driver_snd_init(void);
152 int driver_snd_register(driver_snd_device_t *dev, const driver_snd_ops_t *ops);
155 int driver_snd_play(driver_snd_device_t *dev, const void *buf, int len);
158 int driver_snd_stop(driver_snd_device_t *dev);
161 int driver_snd_set_rate(driver_snd_device_t *dev, u32 rate);
164 int driver_snd_set_volume(driver_snd_device_t *dev, u32 vol);
167 int driver_snd_get_caps(driver_snd_device_t *dev, driver_snd_caps_t *caps);
170 int driver_snd_num_devices(void);
171 driver_snd_device_t *driver_snd_get_device(int idx);
172 int driver_snd_find_by_type(driver_snd_type_t type);
173 int driver_snd_find_first_present(void);
174 void driver_snd_list_devices(void);
175 const char *driver_snd_type_name(driver_snd_type_t type);
181 int driver_snd_probe_all(void);
184 int driver_snd_hda_init(driver_pci_dev_t *pdev);
185 int driver_snd_ac97_init(driver_pci_dev_t *pdev);
186 int driver_snd_sb16_init(void *isa_dev);
187 int driver_snd_es1370_init(driver_pci_dev_t *pdev);
188 int driver_snd_virtio_init(driver_pci_dev_t *pdev);
189 int driver_usb_audio_init(void *driver_usb_dev);
192 void driver_snd_hda_print_state(void);
193 void driver_snd_ac97_print_state(void);
194 void driver_snd_sb16_print_state(void);
195 void driver_snd_es1370_print_state(void);
196 void driver_snd_virtio_print_state(void);
197 void driver_usb_audio_print_state(void);
200 void shell_cmds_snd_test_register(void);
205 int driver_snd_make_tone(void *buf, int cap_bytes, u32 rate, u32 freq, int channels, int ms);

kernel/core/core_health.h

Line Declaration
76 int health_get_cpu(u32 *busy_pct);
77 int health_get_mem(u64 *total_kb, u64 *used_kb, u64 *free_kb);
78 int health_get_tasks(u32 *total, u32 *running, u32 *ready, u32 *blocked);
79 int health_get_io(u64 *disk_read_bytes, u64 *disk_write_bytes, u64 *net_tx_bytes, u64 *net_rx_bytes);
85 int health_export(char *out, int cap);
89 void health_init(void);
92 int health_last(health_sample_t *out);
95 u64 health_sample_count(void);

kernel/core/core_watchdog.h

Line Declaration
74 int watchdog_register(const char *name, u32 timeout_ms, int policy);
80 int watchdog_start(int id);
81 int watchdog_feed(int id);
82 int watchdog_stop(int id);
83 int watchdog_set_timeout(int id, u32 timeout_ms);
87 void watchdog_init(void);
100 int watchdog_count(void);
101 int watchdog_get_info(int id, watchdog_info_t *out);
104 int watchdog_hw_present(void);
105 const char *watchdog_hw_name(void);
106 int watchdog_hw_start(u32 seconds);
107 int watchdog_hw_feed(void);
108 int watchdog_hw_stop(void);
109 int watchdog_hw_set_timeout(u32 seconds);
110 u32 watchdog_hw_timeout(void);
111 u64 watchdog_hw_base(void);
112 int watchdog_hw_armed(void);
113 int watchdog_hw_gcs_noreboot(void);

kernel/lib/lib_klog.h

Line Declaration
72 int klog_write(int level, const char *module, const char *fmt, ...);
77 int klog_set_level(int level);
78 int klog_get_level(void);
83 int klog_set_level_enabled(int level, int on);
84 int klog_get_level_enabled(int level);
89 int klog_flush(void);
93 int klog_flush_panic(void);
98 int klog_rotate(void);
106 void klog_filter_set(int level, const char *module, const char *keyword);
107 void klog_filter_clear(void);
111 void klog_init(void);
112 void klog_grow(void);
113 void klog_on_mount(void);
114 int klog_ring_count(void);
115 int klog_ring_get(int idx, char *out, int cap);
116 void klog_clear(void);
121 void klog_record(int level, const char *module, const char *msg);
124 int klog_filter_active(void);
125 int klog_filter_level(void);
126 const char *klog_filter_module(void);
127 const char *klog_filter_keyword(void);
130 u64 klog_file_bytes(void);
131 int klog_file_open(void);
132 u64 klog_dropped(void);
139 u64 klog_set_rotate_bytes(u64 bytes);
140 u32 klog_set_rotate_keep(u32 keep);
141 u64 klog_get_rotate_bytes(void);
142 u32 klog_get_rotate_keep(void);
144 const char *klog_level_name(int level);

kernel/ota/ota_ab.h

Line Declaration
114 int ota_ab_init(void);
119 int ota_ab_rescan(void);
123 void ota_ab_set_boot_slot_arg(const char *cmdline);
129 void ota_ab_boot_early(void);
133 void ota_update_confirm_boot(void);
138 int ota_ab_current_slot(void);
141 const char *ota_ab_slot_name(int slot);
144 const char *ota_ab_slot_path(int slot);
148 const char *ota_ab_disk_name(void);
151 int ota_ab_flags_ready(void);
155 int ota_ab_read_flags(int *next_boot, int *ok_b, int *bootfail_b);
162 int ota_update_set_boot(const char *slot);
166 int ota_update_rollback(void);
169 int ota_update_get_status(ota_update_status_t *out);
173 int ota_update_download(const char *url, const char *path);
177 int ota_update_verify(const char *path, const char *crypto_sha256_hex);
183 int ota_update_install(const char *pkg_path, const char *slot);
186 const char *ota_update_strerror(int rc);
190 int shell_cmd_update(const char *args);
191 int shell_cmd_rollback(const char *args);
192 int shell_cmd_reboot(const char *args);

kernel/ota/ota_update.h

Line Declaration
112 int ota_update_check(ota_update_info_t *out);
118 int ota_update_check_async(void);
121 const char *ota_update_check_strerror(int rc);
124 int shell_cmd_checkupdate(const char *args);
125 int shell_cmd_checkupdate_test(const char *args);
153 int ota_update_check_pkg(ota_update_pkg_info_t *out);
164 int ota_update_url_parse(const char *url, ota_update_url_t *out);
169 int ota_update_json_string(const char *json, const char *key, char *out, int outlen);
171 int ota_update_json_uint(const char *json, const char *key, u64 *out);
187 int ota_update_changes_v2_url(const char *body, char *url, int cap);
188 int ota_update_fetch_changes_v2(const char *v2url, char *out, int outcap);
192 void ota_update_cache_check(int rc, const char *version);

l1/l1_ext.h

Line Declaration
48 const screen_fb_info_t* l1_ext_fb_get_info(void);
67 screen_renderer_t* l1_ext_set_renderer(screen_renderer_t* new_renderer);
100 int l1_ext_register_font_engine(screen_font_engine_t* engine);
101 screen_font_engine_t* l1_ext_font_engine_by_name(const char* name);
102 screen_font_engine_t* l1_ext_default_font_engine(void);
125 void l1_ext_set_console_hook(screen_console_hook_fn hook, void* ctx);
131 int l1_ext_console_hook(u8 ch);
147 int l1_ext_config_read(const char *key, char *val_out, int outlen);
148 int l1_ext_config_write(const char *key, const char *value);
149 int l1_ext_config_get_all(char *buf, int buflen);
168 int l1_ext_check_update(l1_ext_update_info_t *out);
169 int l1_ext_check_update_async(void);
193 int l1_ext_update_check_pkg(l1_ext_update_pkg_info_t *out);
194 int l1_ext_update_download(const char *url, const char *path);
195 int l1_ext_update_verify(const char *path, const char *crypto_sha256_hex);
196 int l1_ext_update_install(const char *pkg_path, const char *slot);
197 int l1_ext_update_rollback(void);
198 int l1_ext_update_set_boot(const char *slot);
199 int l1_ext_update_get_status(ota_update_status_t *out);
211 int l1_ext_power_shutdown(void);
212 int l1_ext_power_suspend(void);
214 void l1_ext_power_halt(void);
215 void l1_ext_power_reboot(void);
216 int l1_ext_shell_register_command_ex(const char *name, int (*fn)(const char *), const char *help, const char *wp);
218 void l1_ext_shell_list_commands_a_z(void);
219 void l1_ext_shell_list_commands_by_wp(void);
226 int l1_ext_self_test(void);

l1/l1_wp8a.h

Line Declaration
18 pid_t sys_proc_fork(void);
19 int sys_proc_exec(const char *path, const char *argv[], const char *envp[]);
20 pid_t sys_proc_wait(pid_t pid, int *status);
21 void sys_proc_exit(int code) __attribute__((noreturn));
22 pid_t sys_proc_getpid(void);
23 pid_t sys_proc_getppid(void);
24 int pipe_create(int pipefd[2]);
25 int fd_dup(int oldfd);
26 int fd_dup2(int oldfd, int newfd);
27 signal_handler_fn signal_register(int sig, signal_handler_fn handler);
28 int signal_send(pid_t pid, int sig);
29 int signal_return(void);
30 void *sys_mem_mmap(void *addr, u64 length, int prot);
31 int sys_mem_munmap(void *addr, u64 length);
32 int sys_mem_mprotect(void *addr, u64 length, int prot);
33 void *sys_mem_brk(void *addr);
34 int sys_chdir(const char *path);
35 char *sys_getcwd(char *buf, u64 size);
36 int sys_ioctl(int fd, u64 cmd, void *arg);
37 int sys_select(int nfds, void *readfds, u32 timeout_ms);
39 int sys_poll(pollfd_t *fds, u64 nfds, i64 timeout_ms);
54 int l1_socket(int type);
55 int l1_net_bind(int sock, u32 ip, u16 port);
56 int l1_net_connect(int sock, u32 ip, u16 port);
57 int l1_net_accept(int lsock, u32 *client_ip, u16 *client_port);
58 int l1_net_send(int sock, const void *buf, int len);
59 int l1_net_recv(int sock, void *buf, int maxlen);
60 int l1_net_close(int sock);

l1/l1_wp8b.h

Line Declaration
35 int elf_load_dynamic(const u8 *elf_data, u64 elf_size, const char *name);
44 u64 ldso_run(void);
56 u64 so_load(const char *name, u64 flags);
66 int so_unload(u64 handle);
77 u64 symbol_resolve(u64 handle, const char *name);
81 u64 dlsym_impl(u64 handle, const char *name);
85 u64 dlopen_impl(const char *name, u64 flags);
89 int dlclose_impl(u64 handle);
108 void reloc_apply(const void *rela_data, u64 count, u64 base, u64 symtab_addr, u64 strtab_addr, u64 libfoo_base, u64 libfoo_symtab, u64 libfoo_strtab);
130 int elf_get_needed(const u8 *elf_data, u64 elf_size, const char *needed_out[], int max_count);
137 int ext_wp8b_selftest(void);

l1/l1_wp8cd.h

Line Declaration
24 int shell_run(void);
33 int shell_register_builtin(const char *name, shell_builtin_fn fn, const char *help);
37 int shell_unregister_builtin(const char *name);
45 int tool_register(const char *name, const u8 *elf_data, u64 elf_size);
50 int tool_list(char *buf, int bufsize);
59 int job_create(const char *cmd);
65 int job_list(char *buf, int bufsize);
74 int job_control(int job_id, int action);

tui/tui_ext.h

Line Declaration
55 int tui_menu_register(const char *owner, const char *name, const char *desc, const char *icon, const char *group, int hotkey, int priority, int (*action)(void), void *userptr);
59 int tui_menu_unregister(const char *name);
60 int tui_menu_list(tui_menuext_item_t *out, int cap);
61 int tui_menu_sort(void);
83 int tui_page_register(const char *owner, const char *name, const char *title, const char *group, int priority, int (*render)(tui_window_t *, int), int (*input)(int), void *userptr);
88 int tui_page_unregister(const char *name);
89 int tui_page_list(char (*out)[TUI_EXT_NAME_MAX], int cap);
90 int tui_page_render(const char *name, tui_window_t *win, int scroll);
91 int tui_page_input(const char *name, int key);
92 int tui_ext_page_main(const char *name);
119 int tui_widget_register(const char *owner, const char *type, const char *name, int x, int y, int w, int h, tui_attr_t attr, int (*render)(tui_window_t *, int, int, int, int), int (*event)(int), void *userptr);
124 int tui_widget_unregister(const char *name);
125 int tui_widget_list(tui_widgetext_t *out, int cap);
126 int tui_widget_render(const char *name, tui_window_t *win);
127 int tui_widget_event(const char *name, int ev);
143 int tui_cmd_register(const char *owner, const char *name, const char *args, const char *desc, int (*fn)(int argc, char **argv), void *userptr);
146 int tui_cmd_unregister(const char *name);
147 int tui_cmd_list(tui_cmdext_t *out, int cap);
148 int tui_cmd_execute(const char *line);
163 int tui_theme_register(const char *owner, const char *name, const char *desc, int fg, int bg, void *userptr);
165 int tui_theme_unregister(const char *name);
166 int tui_theme_list(tui_themeext_t *out, int cap);
167 int tui_theme_set(const char *name);
168 const char *tui_theme_current(void);
185 int tui_key_register(const char *owner, int key, int mods, const char *name, const char *desc, int (*fn)(void), void *userptr);
188 int tui_key_unregister(const char *name);
189 int tui_key_list(tui_keyext_t *out, int cap);
190 int tui_key_conflict(int key, int mods);
192 int tui_key_dispatch(int key, int mods);
211 int tui_event_register(const char *owner, const char *type, const char *name, int (*handler)(const char *, void *), void *userptr);
214 int tui_event_unregister(const char *name);
215 int tui_event_list(tui_eventext_t *out, int cap);
216 int tui_event_dispatch(const char *type, void *payload);
222 void tui_ext_init(void);
223 void tui_ext_register_ext_page(void);
224 void tui_ext_reset(void);
225 int tui_ext_selftest(void);

Part 3 - Syscall surface (53)

Defined in kernel/core/core_syscall.h (#define SYS_*). ABI: rax = number, rdi/rsi/rdx/r10 = arguments, rax = result (>= 0 success, < 0 error). The authoritative list is the header; the L1 syscall wrappers are declared in l1/l1_wp8a.h.

Clone this wiki locally