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
developersguide:kernelapi [2015/01/08 02:06]
lazarstricevic [SYS_PHYSCOPY] Corrected link
developersguide:kernelapi [2016/07/08 13:50] (current)
antoineleca link
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 101: Line 109:
 **library functions**\\ int sys_abort(int shutdown_status,​ ...); **library functions**\\ int sys_abort(int shutdown_status,​ ...);
  
-==== SYS_CPROF ​====+==== SYS_CLEAR ​====
 **request parameters**\\ //(to be documented)//​ **request parameters**\\ //(to be documented)//​
  
Line 107: Line 115:
  
 **return value**\\ //(to be documented)//​ **return value**\\ //(to be documented)//​
 +
 +**library functions**\\ //(to be documented)//​
 +
 +==== .SYS_CPROF ====
 +Obsolete call
  
 **library functions**\\ int sys_cprof(int action, int size, int endpt, void *ctl_ptr, void *mem_ptr); **library functions**\\ int sys_cprof(int action, int size, int endpt, void *ctl_ptr, void *mem_ptr);
Line 128: Line 141:
  
 **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 148: Line 170:
  
 ==== SYS_EXIT ==== ==== SYS_EXIT ====
 +**NOTE**: obsolete description,​ has changed in relation with SYS_CLEAR and SYS_UPDATE.
 +
 Clear a process slot. This call is to be used by PM only. Clear a process slot. This call is to be used by PM only.
  
Line 208: Line 232:
  
 **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 ====
 +Obsolete call
  
 ==== SYS_IOPENABLE ==== ==== SYS_IOPENABLE ====
Line 246: Line 282:
  
  
 +==== 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_NEWMAP ====
 +This is an obsolete call. Description is kept here just to understand old code.
  
-==== SYS_NEWMAP ==== 
 Install a new memory map for a newly forked process or if a process'​s memory map is changed. The kernel fetches the new memory map from PM and updates its data structures. Install a new memory map for a newly forked process or if a process'​s memory map is changed. The kernel fetches the new memory map from PM and updates its data structures.
  
Line 256: Line 309:
 **library functions**\\ int sys_newmap(endpoint_t proc_nr, struct mem_map *ptr); **library functions**\\ int sys_newmap(endpoint_t proc_nr, struct mem_map *ptr);
  
-==== SYS_NICE ====+==== .SYS_NICE ==== 
 +This is an obsolete call. Description is kept here just to understand old code. 
 Change a process'​ priority. This is done by passing a nice value between PRIO_MIN(negative) and PRIO_MAX(positive). A nice value of zero resets the priority to the default. Change a process'​ priority. This is done by passing a nice value between PRIO_MIN(negative) and PRIO_MAX(positive). A nice value of zero resets the priority to the default.
  
Line 264: Line 319:
  
 **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 294: Line 358:
 **library functions**\\ int sys_privctl(endpoint_t proc, int req, void *p);\\ int sys_privquery_mem(endpoint_t proc, phys_bytes start, phys_bytes len); **library functions**\\ int sys_privctl(endpoint_t proc, int req, void *p);\\ int sys_privquery_mem(endpoint_t proc, phys_bytes start, phys_bytes len);
  
-==== SYS_PROFBUF ==== +==== .SYS_PROFBUF ==== 
-**request parameters**\\ //(to be documented)//​ +Obsolete call.
- +
-**response parameters**\\ //(to be documented)//​ +
- +
-**return value**\\ //(to be documented)//​ +
- +
-**library functions**\\ int sys_profbuf(void *ctl_ptr, void *mem_ptr);+
  
 ==== SYS_READBIOS ==== ==== SYS_READBIOS ====
Line 345: Line 403:
  
 **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 474:
  
 **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 512:
  
 ==== 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 419: Line 538:
 **library functions**\\ int sys_stime(time_t boottime); **library functions**\\ int sys_stime(time_t boottime);
  
-==== SYS_SYSCTL ==== +==== .SYS_SYSCTL ==== 
-**request parameters**\\ //(to be documented)//​ +Renamed ​to [[#​sys_diagctl|SYS_DIAGCTL]].
- +
-**response parameters**\\ //(to be documented)//​ +
- +
-**return value**\\ //(to be documented)//​ +
- +
-**library functions**\\ //(to be documented)//​+
  
 ==== SYS_TIMES ==== ==== SYS_TIMES ====
Line 476: Line 589:
  
 **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 665:
  
 **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.1420679193.txt.gz · Last modified: 2016/07/08 13:13 (external edit)