User Tools

Site Tools


developersguide:kernelapi

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Next revision Both sides next revision
developersguide:kernelapi [2015/01/07 20:06]
lazarstricevic [SYS_PHYSCOPY] Corrected link
developersguide:kernelapi [2016/07/08 07:35]
antoineleca Add stubs for missing calls
Line 27: Line 27:
 |[[#​sys_fork|SYS_FORK]] |Fork a process; copy parent process | |[[#​sys_fork|SYS_FORK]] |Fork a process; copy parent process |
 |[[#​sys_exec|SYS_EXEC]] |Execute a process; initialize registers | |[[#​sys_exec|SYS_EXEC]] |Execute a process; initialize registers |
-|[[#sys_exit|SYS_EXIT]] |Exit a user process; clear process slot | +|[[#sys_clear|SYS_CLEAR]] |Exit a user process; clear process slot | 
-|[[#sys_nice|SYS_NICE]] |Change priority ​of a user process |+|[[#sys_exit|SYS_EXIT]] |Exit a system process | 
 +|[[#​sys_update|SYS_UPDATE]] |Update state of a system ​process ​
 +|[[#​sys_schedule|SYS_SCHEDULE]] |Scheduler | 
 +|[[#​sys_schedctl|SYS_SCHEDCTL]] |Change scheduler control ​|
 |[[#​sys_privctl|SYS_PRIVCTL]] |Change system process privileges | |[[#​sys_privctl|SYS_PRIVCTL]] |Change system process privileges |
 |[[#​sys_trace|SYS_TRACE]] |Trace or control ​ process execution | |[[#​sys_trace|SYS_TRACE]] |Trace or control ​ process execution |
 |[[#​sys_setgrant|SYS_SETGRANT]] |Tell kernel about grant table | |[[#​sys_setgrant|SYS_SETGRANT]] |Tell kernel about grant table |
 |[[#​sys_runctl|SYS_RUNCTL]] |Set/clear stop flag of a process | |[[#​sys_runctl|SYS_RUNCTL]] |Set/clear stop flag of a process |
 +|[[#​sys_getmcontext|SYS_GETMCONTEXT]] |Get context of a process |
 +|[[#​sys_setmcontext|SYS_SETMCONTEXT]] |Get context of a process |
 ||//SIGNAL HANDLING// | ||//SIGNAL HANDLING// |
 |[[#​sys_kill|SYS_KILL]] |Send a signal to a process | |[[#​sys_kill|SYS_KILL]] |Send a signal to a process |
Line 43: Line 48:
 |[[#​sys_memset|SYS_MEMSET]] |Fill a physical memory area with a constant pattern byte | |[[#​sys_memset|SYS_MEMSET]] |Fill a physical memory area with a constant pattern byte |
 |[[#​sys_vmctl|SYS_VMCTL]] |//(to be documented)//​ | |[[#​sys_vmctl|SYS_VMCTL]] |//(to be documented)//​ |
 +|[[#​sys_padconf|SYS_PADCONF]] |//(to be documented)//​ |
 ||//COPYING DATA// | ||//COPYING DATA// |
 |[[#​sys_umap|SYS_UMAP]] |Map virtual to physical address | |[[#​sys_umap|SYS_UMAP]] |Map virtual to physical address |
 +|[[#​sys_umap_remote|SYS_UMAP_REMOTE]] |Map virtual to physical address |
 |[[#​sys_vumap|SYS_VUMAP]] |Batch map virtual to physical addresses | |[[#​sys_vumap|SYS_VUMAP]] |Batch map virtual to physical addresses |
 |[[#​sys_vircopy|SYS_VIRCOPY]] |Copy data using virtual addressing | |[[#​sys_vircopy|SYS_VIRCOPY]] |Copy data using virtual addressing |
Line 62: Line 69:
 |[[#​sys_abort|SYS_ABORT]] |Abort MINIX: shutdown the system | |[[#​sys_abort|SYS_ABORT]] |Abort MINIX: shutdown the system |
 |[[#​sys_getinfo|SYS_GETINFO]] |Get a copy system info or kernel data | |[[#​sys_getinfo|SYS_GETINFO]] |Get a copy system info or kernel data |
-|[[#sys_sysctl|SYS_SYSCTL]] |//(to be documented)//​ |+|[[#sys_diagctl|SYS_DIAGCTL]] |//(to be documented)//​ |
 ||//CLOCK FUNCTIONALITY//​ | ||//CLOCK FUNCTIONALITY//​ |
 |[[#​sys_setalarm|SYS_SETALARM]] |Set or reset a synchronous alarm timer | |[[#​sys_setalarm|SYS_SETALARM]] |Set or reset a synchronous alarm timer |
 |[[#​sys_times|SYS_TIMES]] |Get process times, boot time and uptime | |[[#​sys_times|SYS_TIMES]] |Get process times, boot time and uptime |
 |[[#​sys_stime|SYS_STIME]] |Set boot time | |[[#​sys_stime|SYS_STIME]] |Set boot time |
 +|[[#​sys_settime|SYS_SETTIME]] |Update time |
 |[[#​sys_vtimer|SYS_VTIMER]] |Set or retrieve a process virtual timer | |[[#​sys_vtimer|SYS_VTIMER]] |Set or retrieve a process virtual timer |
 ||//​PROFILING//​ | ||//​PROFILING//​ |
Line 100: Line 108:
  
 **library functions**\\ int sys_abort(int shutdown_status,​ ...); **library functions**\\ int sys_abort(int shutdown_status,​ ...);
 +
 +==== SYS_CLEAR ====
 +**request parameters**\\ //(to be documented)//​
 +
 +**response parameters**\\ //(to be documented)//​
 +
 +**return value**\\ //(to be documented)//​
 +
 +**library functions**\\ //(to be documented)//​
  
 ==== SYS_CPROF ==== ==== SYS_CPROF ====
Line 128: Line 145:
  
 **library functions**\\ int sys_in(port_t port, unsigned long value, int io_type);\\ int sys_inb(port_t port, u8_t *byte);\\ int sys_inw(port_t port, u16_t *word);\\ int sys_inl(port_t port, u32_t *long);\\ int sys_out(port_t port, unsigned long value, int io_type);\\ int sys_outb(port_t port, u8_t byte);\\ int sys_outw(port_t port, u16_t word);\\ int sys_outl(port_t port, u32t long);\\ **library functions**\\ int sys_in(port_t port, unsigned long value, int io_type);\\ int sys_inb(port_t port, u8_t *byte);\\ int sys_inw(port_t port, u16_t *word);\\ int sys_inl(port_t port, u32_t *long);\\ int sys_out(port_t port, unsigned long value, int io_type);\\ int sys_outb(port_t port, u8_t byte);\\ int sys_outw(port_t port, u16_t word);\\ int sys_outl(port_t port, u32t long);\\
 +
 +==== SYS_DIAGCTL ====
 +**request parameters**\\ //(to be documented)//​
 +
 +**response parameters**\\ //(to be documented)//​
 +
 +**return value**\\ //(to be documented)//​
 +
 +**library functions**\\ //(to be documented)//​
  
 ==== SYS_ENDKSIG ==== ==== SYS_ENDKSIG ====
Line 208: Line 234:
  
 **library functions**\\ int sys_getksig(endpoint_t *proc_nr, sigset_t *sig_map); **library functions**\\ int sys_getksig(endpoint_t *proc_nr, sigset_t *sig_map);
 +
 +==== SYS_GETMCONTEXT ====
 +**request parameters**\\ //(to be documented)//​
 +
 +**response parameters**\\ //(to be documented)//​
 +
 +**return value**\\ //(to be documented)//​
 +
 +**library functions**\\ //(to be documented)//​
 +
 +==== SYS_INT86 ====
 +**request parameters**\\ //(to be documented)//​
 +
 +**response parameters**\\ //(to be documented)//​
 +
 +**return value**\\ //(to be documented)//​
 +
 +**library functions**\\ //(to be documented)//​
  
 ==== SYS_IOPENABLE ==== ==== SYS_IOPENABLE ====
Line 245: Line 289:
 **library functions**\\ int sys_kill(endpoint_t proc_nr, int sig_nr); **library functions**\\ int sys_kill(endpoint_t proc_nr, int sig_nr);
  
 +
 +==== SYS_MEMSET ====
 +Fill a physical memory area with a constant pattern byte.
 +
 +<​code>​
 +int sys_memset(endpoint_t who, unsigned long pattern, phys_bytes base, phys_bytes bytes);
 +</​code>​
 +
 +The **sys_memset** function sets //length// bytes starting from physical address //base// to the low-order byte of //​pattern//​.
 +
 +**Return values**:\\
 +OK: Call always succeeds.
 +
 +**Notes**: \\
 +This function is used, for example, to zero the BSS segment on an exec() POSIX-call. The kernel is asked to do the work for performance reasons.
  
  
Line 264: Line 323:
  
 **library functions**\\ int sys_nice(endpoint_t proc_nr, int priority); **library functions**\\ int sys_nice(endpoint_t proc_nr, int priority);
 +
 +==== SYS_PADCONF ====
 +**request parameters**\\ //(to be documented)//​
 +
 +**response parameters**\\ //(to be documented)//​
 +
 +**return value**\\ //(to be documented)//​
 +
 +**library functions**\\ //(to be documented)//​
  
 ==== SYS_PHYSCOPY ==== ==== SYS_PHYSCOPY ====
Line 345: Line 413:
  
 **library functions**\\ int sys_safecopyto(endpoint_t dest, cp_grant_id_t grant, vir_bytes grant_offset,​ vir_bytes my_address, size_t bytes); **library functions**\\ int sys_safecopyto(endpoint_t dest, cp_grant_id_t grant, vir_bytes grant_offset,​ vir_bytes my_address, size_t bytes);
 +
 +==== SYS_SAFEMEMSET ====
 +Fill a memory grant with a constant pattern byte.
 +
 +<​code>​
 +int sys_safememset(endpoint_t endpt, cp_grant_id_t grant, vir_bytes grant_offset,​ int pattern, size_t bytes);
 +</​code>​
 +The **sys_safememset** function sets //bytes// bytes from offset //​grant_offset//​ in memory grant //grant// to the low-order byte of //​pattern//​.
 +
 +**Return values** (not complete):​\\
 +OK: //bytes// bytes filled with the pattern byte.\\
 +EPERM: Caller has no write permissions (CPF_WRITE) for //grant//. \\
 +EPERM: Permission checks for //grant// failed. \\
 +
 +**Notes:** \\
 +The memory driver uses this function for reads of /dev/zero to set a requestor'​s buffer to all '​\0'​.
 +
 +==== SYS_SCHEDCTL ====
 +**request parameters**\\ //(to be documented)//​
 +
 +**response parameters**\\ //(to be documented)//​
 +
 +**return value**\\ //(to be documented)//​
 +
 +**library functions**\\ //(to be documented)//​
 +
 +==== SYS_SCHEDULE ====
 +**request parameters**\\ //(to be documented)//​
 +
 +**response parameters**\\ //(to be documented)//​
 +
 +**return value**\\ //(to be documented)//​
 +
 +**library functions**\\ //(to be documented)//​
  
 ==== SYS_SDEVIO ==== ==== SYS_SDEVIO ====
Line 382: Line 484:
  
 **library functions**\\ int sys_setgrant(cp_grant_t *grants, int ngrants); **library functions**\\ int sys_setgrant(cp_grant_t *grants, int ngrants);
 +
 +==== SYS_SETMCONTEXT ====
 +**request parameters**\\ //(to be documented)//​
 +
 +**response parameters**\\ //(to be documented)//​
 +
 +**return value**\\ //(to be documented)//​
 +
 +**library functions**\\ //(to be documented)//​
 +
 +==== SYS_SETTIME ====
 +**request parameters**\\ //(to be documented)//​
 +
 +**response parameters**\\ //(to be documented)//​
 +
 +**return value**\\ //(to be documented)//​
 +
 +**library functions**\\ //(to be documented)//​
  
 ==== SYS_SIGRETURN ==== ==== SYS_SIGRETURN ====
Line 402: Line 522:
  
 ==== SYS_SPROF ==== ==== SYS_SPROF ====
 +**request parameters**\\ //(to be documented)//​
 +
 +**response parameters**\\ //(to be documented)//​
 +
 +**return value**\\ //(to be documented)//​
 +
 +**library functions**\\ //(to be documented)//​
 +
 +==== SYS_STATECTL ====
 **request parameters**\\ //(to be documented)//​ **request parameters**\\ //(to be documented)//​
  
Line 476: Line 605:
  
 **library functions**\\ int sys_umap(endpoint_t proc_nr, int seg, vir_bytes vir_addr, vir_bytes count, phys_bytes *phys_addr);​ **library functions**\\ int sys_umap(endpoint_t proc_nr, int seg, vir_bytes vir_addr, vir_bytes count, phys_bytes *phys_addr);​
 +
 +==== SYS_UMAP_REMOTE ====
 +**request parameters**\\ //(to be documented)//​
 +
 +**response parameters**\\ //(to be documented)//​
 +
 +**return value**\\ //(to be documented)//​
 +
 +**library functions**\\ //(to be documented)//​
 +
 +==== SYS_UPDATE ====
 +**request parameters**\\ //(to be documented)//​
 +
 +**response parameters**\\ //(to be documented)//​
 +
 +**return value**\\ //(to be documented)//​
 +
 +**library functions**\\ //(to be documented)//​
  
 ==== SYS_VDEVIO ==== ==== SYS_VDEVIO ====
Line 534: Line 681:
  
 **library functions**\\ int sys_vtimer(endpoint_t proc_nr, int which, clock_t *newval, clock_t *oldval); **library functions**\\ int sys_vtimer(endpoint_t proc_nr, int which, clock_t *newval, clock_t *oldval);
- 
- 
- 
-==== SYS_MEMSET ==== 
-Fill a physical memory area with a constant pattern byte. 
- 
-<​code>​ 
-int sys_memset(endpoint_t who, unsigned long pattern, phys_bytes base, phys_bytes bytes); 
-</​code>​ 
- 
-The **sys_memset** function sets //length// bytes starting from physical address //base// to the low-order byte of //​pattern//​. 
- 
-**Return values**:\\ 
-OK: Call always succeeds. 
- 
-**Notes**: \\ 
-This function is used, for example, to zero the BSS segment on an exec() POSIX-call. The kernel is asked to do the work for performance reasons. 
- 
- 
- 
-==== SYS_SAFEMEMSET ==== 
-Fill a memory grant with a constant pattern byte. 
- 
-<​code>​ 
-int sys_safememset(endpoint_t endpt, cp_grant_id_t grant, vir_bytes grant_offset,​ int pattern, size_t bytes); 
-</​code>​ 
-The **sys_safememset** function sets //bytes// bytes from offset //​grant_offset//​ in memory grant //grant// to the low-order byte of //​pattern//​. 
- 
-**Return values** (not complete):​\\ 
-OK: //bytes// bytes filled with the pattern byte.\\ 
-EPERM: Caller has no write permissions (CPF_WRITE) for //grant//. \\ 
-EPERM: Permission checks for //grant// failed. \\ 
- 
-**Notes:** \\ 
-The memory driver uses this function for reads of /dev/zero to set a requestor'​s buffer to all '​\0'​. 
  
  
developersguide/kernelapi.txt · Last modified: 2016/07/08 07:50 by antoineleca