Contur 2
Educational OS kernel simulator
Loading...
Searching...
No Matches
program_syscalls.h File Reference

Inline syscall sequence emitters using the kernel register convention. More...

Go to the source code of this file.

Namespaces

namespace  contur

Functions

void contur::emitOpen (std::vector< Block > &code, RegisterValue resourceId, IoResourceKind kind, OpenMode mode)
 Emits instructions to open a kernel I/O resource.
void contur::emitRead (std::vector< Block > &code, std::uint8_t fdReg)
 Emits instructions to read one value from a kernel I/O descriptor.
void contur::emitWrite (std::vector< Block > &code, std::uint8_t fdReg, std::uint8_t valReg)
 Emits instructions to write one value to a kernel I/O descriptor.
void contur::emitClose (std::vector< Block > &code, std::uint8_t fdReg)
 Emits instructions to close a kernel I/O descriptor.

Detailed Description

Inline syscall sequence emitters using the kernel register convention.

Each emitter appends one complete syscall sequence to a program buffer. The calling convention (which registers carry the syscall id and arguments) is defined in syscall_conventions.h. Emitters handle the encoding so that demo programs only express intent, not ABI details.

Definition in file program_syscalls.h.