[Kos-cvs] [kos] Modification CVS par thomas

KOS CVS kos at kos.enix.org
Mon Oct 27 16:37:33 CET 2003

Module :	kos
Modifié par :	thomas	27/10/03 16:37:32

Fichiers modifiés :
	.              : ChangeLog MkRules MkVars TODO 
	modules/elf    : _elf.c _elf.h elf.c elf.h 
	modules/fs/fat : _fat.h _fat_karm.c 
	modules/ide    : _ide_karm.c 
	modules/karm   : Makefile get_intf_id.sh interface.c interface.h 
	                 karm.c karm.h kres.c ures.c ures.h view.h 
	modules/karm/interface: char.xml mapping.xml 
	modules/kos    : errno.c errno.h system.h types.h wolfgang.c 
	modules/lib    : Makefile 
	modules/lib/blockfile: libblockfile.c 
	modules/lib/bst: _splay.c 
	modules/lib/filemap: libfilemap.c 
	modules/scheduler: _scheduler.c 
	modules/task   : Makefile _task.h _task_init.c _task_team.c 
	                 _task_thread.c _task_ures.c _task_uthread.c 
	                 _task_utils.c task.c task.h 
	modules/tty    : _tty.c _tty_kres.c tty.c 
	modules/vmm    : _dev_zero.c _vmm_as.c _vmm_map.c vmm.c vmm.h 
	modules/x86/mm : _pgflt.c _team_mm_context.c _vmap.c mm.c mm.h 
	modules/x86/task: Makefile _dbflt.c _task.h 
	                  _thread_cpu_context.c task.c task.h 
	utils          : kosidl.c 
Fichiers ajoutés :
	modules/karm   : syscall.c 
	modules/karm/interface: process.xml 
	modules/task   : _task_kres.c 
	modules/x86/task: _syscall.c 
Fichiers enlevés :
	modules/task   : _task_sres.c 

Détails :
2003-10-27  Thomas Petazzoni  <thomas at enix.org>

* modules/arch/task/_thread_cpu_context.c
(init_user_thread_context): User threads works (and memory map
(copy_user_thread_context): Copy user thread context (during

* modules/karm/syscall.c (syscall): Connection between the low
level syscall entry point and the karm interfaces/methods.

* modules/arch/task/_syscall.c (syscall_entry_point): Low level
syscall entry point.

* modules/arch/task/_dbflt.c (double_fault_handler): Show the
address of the fault (CR2).

* modules/arch/mm/_vmap.c (arch_range_dup): Duplicates a range of
PT's (during fork).

* modules/arch/mm/_team_mm_context.c
(arch_team_mm_context_switch): Really switch address spaces ;)

* modules/vmm/vmm.h (struct address_space): Added heap_start and
heap_current fields.
(struct virtual_region): Added pos_in_ures, flags and region_type

* modules/vmm/_vmm_map.c (protect_virtual_range): New function.
(get_paddr_at_vaddr): New function.

* modules/vmm/_vmm_as.c (vr_copy): Function that copies a virtual
region to an other team.
(as_copy): Copy an address space (during fork).
(as_empty): Remove all regions from an address space (during exec).
(as_page_fault): Handles dynamic stack expansion, COW and anonymous
(as_map_ures): Handles MAP_FIXED regions (when the space is
(as_change_heap): Implementation of the brk() system call.
(as_update_heap_start): Update the heap start address.

* modules/vmm/_dev_zero.c: Simplification of the implementation
(due to a change in the mapping interface).

* modules/tty/_tty_kres.c (_make_tty_kres): Tty uses the
libcharfile library to export the FILE interface.

* modules/task/_task_kres.c: The process 'kres' that allows to
call fork, exec, getpid, getppid, open, brk ... from the user

* modules/task/task.h: Added parent, pid and thread_count fields
to the team structure.

* modules/task/_task_utils.c (set_current_thread): The movl %0,
%%cr3 now takes place in arch-dependent file. Vmm is much cleaner ;-)

* modules/task/_task_uthread.c (create_user_thread): User threads works.
(copy_user_thread): New function that allows to copy a thread
during fork.

* modules/task/_task_ures.c: Insertion/deletion of ures in the
ures array of each team works ;)

* modules/task/_task_team.c: New task_fork(), task_exec(),
task_getpid() and task_getppid() functions.

* modules/task/Makefile (OBJS): New _task_kres file.

* modules/scheduler/_scheduler.c
(scheduler_retrieve_next_thread_internal): Update system TSS
correctly so that user threads work.

* modules/lib/filemap/libfilemap.c: Simplification of this library
: most of its job is now factorized in the vmm module. Its only
really job is to page_in the data.

* modules/lib/bst/_splay.c (_splay_visit_in_order)
(_splay_visit_reverse_order): Return NULL instead of current node.

* modules/lib/blockfile/libblockfile.c (lbf_copy_ures): New
function to copy the ures.

* modules/lib/Makefile (SUBDIRS): New charfile library.

* modules/kos/wolfgang.c: New mount_root function to mount the
root filesystem. New init_first_user_team function that creates
the first user team, and runs the first program (/file/test).

* modules/kos/types.h: New pid_t type.

* modules/kos/system.h: HZ is now 100. New macros that correctly
defines the memory map of the user space.

* modules/kos/errno.c, modules/kos/errno.h: New errnos.

* modules/karm/interface/mapping.xml: Map function doesn't require
the pos_in_ures parameter anymore (it's included in the struct

* modules/karm/interface/char.xml: Replaced size_t* len with
size_t len to match the current char interface inside the
kernel. We should later change it back to size_t* len in order to
be able to return the number of bytes that have actually been

* modules/karm/view.h: Each view needs a new specific method :

* modules/karm/ures.c (ures_copy): New function that copies an
ures (during fork).
(ures_array_copy): New function that copies the complete
ures_array of a team (during fork).

* modules/karm/interface.c (interface_method_check): New function
that checks whether a method call is valid (the method exists and
the number of arguments is valid).

* modules/karm/get_intf_id.sh: The wc -l | cut stuff did not work
on Linux. Replaced with a sed -n $= command.

* modules/karm/Makefile (OBJS): New syscall.c file.

* modules/ide/_ide_karm.c (_ide_register_disk): Added necessary
calls to devfs_unregister.

* modules/fs/fat/_fat_karm.c (fat_dir_copy_ures)
(fat_file_copy_ures): New functions to copy an ures (needed to
duplicate ures during fork).

* modules/elf/_elf.h: Some nice ELF defines.

* modules/elf/_elf.c (elf_identify): New function that checks
whether the given ures is a valid ELF file.
(elf_load): This functions loads an ELF file (create the
corresponding regions), and returns the code_start and the
heap_start addresses.

* TODO: Some new ideas for XML files.

* MkVars: Added libcharfile module.

* MkRules: Added NO_DEP=1 to disable dependencies generation : the
generation occurs multiple times, sometimes 2, sometimes 20,
sometimes more => it's impossible to compile.

More information about the Kos-cvs mailing list