diff --git a/doc/xml/8259_8c.xml b/doc/xml/8259_8c.xml
index 35ce12e..949bd5a 100644
--- a/doc/xml/8259_8c.xml
+++ b/doc/xml/8259_8c.xml
@@ -6,40 +6,40 @@
sys/io.h
lib/kprintf.h
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
diff --git a/doc/xml/8259_8h.xml b/doc/xml/8259_8h.xml
index 2b8f1cf..9a8bb26 100644
--- a/doc/xml/8259_8h.xml
+++ b/doc/xml/8259_8h.xml
@@ -15,97 +15,97 @@
src/sys/pci/lnc.c
src/sys/sys/idt.c
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
@@ -300,7 +300,7 @@
_int13
- kpanic
+ kpanic
ne2kHandler
diff --git a/doc/xml/__types_8h.xml b/doc/xml/__types_8h.xml
index 851f392..b0190ac 100644
--- a/doc/xml/__types_8h.xml
+++ b/doc/xml/__types_8h.xml
@@ -5,1567 +5,1565 @@
src/sys/include/ubixos/times.h
src/sys/include/ubixos/types.h
-
+
-
+
-
+
-
+
-
+
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-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
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
diff --git a/doc/xml/ap-boot_8S.xml b/doc/xml/ap-boot_8S.xml
index ac1f7e1..131beb9 100644
--- a/doc/xml/ap-boot_8S.xml
+++ b/doc/xml/ap-boot_8S.xml
@@ -455,13 +455,15 @@
addDirEntry
biosCall
- execFile
+ elf_loadfile
+ execFile
fstat
initLNC
kmod_load
ldEnable
mmap
- sysExec
+ sys_exec
+ sysExec
ubixFSUnlink
vmm_cleanVirtualSpace
vmm_getFreeMallocPage
@@ -492,7 +494,7 @@
cpuInfo
- execFile
+ execFile
hdWrite
diff --git a/doc/xml/arp_8h.xml b/doc/xml/arp_8h.xml
index 599c3ad..cbfa69a 100644
--- a/doc/xml/arp_8h.xml
+++ b/doc/xml/arp_8h.xml
@@ -6,23 +6,23 @@
net/ipv4/ip_addr.h
net/netif.h
-
+
-
+
-
+
-
+
-
+
-
+
-
+
diff --git a/doc/xml/assert_8c.xml b/doc/xml/assert_8c.xml
index cb63a7e..bad2515 100644
--- a/doc/xml/assert_8c.xml
+++ b/doc/xml/assert_8c.xml
@@ -6,37 +6,37 @@
lib/kprintf.h
ubixos/kpanic.h
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
@@ -64,13 +64,13 @@
failedexpr
-
+The underlying assertion call which is wrapped by [assert()].
-
- kpanic
+
+ K_PANIC
kprintf
NULL
@@ -113,41 +113,19 @@
#include<[lib/kprintf.h]>
#include<[ubixos/kpanic.h]>
-void[__assert](constchar*func,constchar*[file],intline,constchar*failedexpr){
-if(func==[NULL])
-[kprintf](
-"Assertionfailed:(%s),file%s,line%d.\n",failedexpr,
-file,line);
-else
-[kprintf](
-"Assertionfailed:(%s),function%s,file%s,line%d.\n",
-failedexpr,func,file,line);
-[kpanic]("Asserted\n");
-}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+void[__assert](constchar*func,constchar*[file],intline,constchar*failedexpr){
+if(func==[NULL])
+[kprintf]("Assertionfailed:(%s),file%s,line%d.\n",failedexpr,file,line);
+else
+[kprintf]("Assertionfailed:(%s),function%s,file%s,line%d.\n",failedexpr,func,file,line);
+
+[K_PANIC]("Asserted\n");
+}
+
+
+
+
+
diff --git a/doc/xml/assert_8h.xml b/doc/xml/assert_8h.xml
index 514ea8f..0c11812 100644
--- a/doc/xml/assert_8h.xml
+++ b/doc/xml/assert_8h.xml
@@ -24,133 +24,133 @@
src/sys/vmm/paging.c
src/sys/vmm/vmm_memory.c
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
@@ -202,8 +202,8 @@
adjustCowCounter
biosCall
- execFile
- execThread
+ execFile
+ execThread
fclose
fork_copyProcess
fread
@@ -217,7 +217,7 @@
openFileUbixFS
PCtoNIC
readUbixFS
- sysExec
+ sysExec
ubixfs_cacheAdd
ubixfs_cacheFind
ubixfs_cacheNew
@@ -246,13 +246,13 @@
const char *
-
+The underlying assertion call which is wrapped by [assert()].
-
- kpanic
+
+ K_PANIC
kprintf
NULL
diff --git a/doc/xml/atan_8c.xml b/doc/xml/atan_8c.xml
index e35e3ef..95771e4 100644
--- a/doc/xml/atan_8c.xml
+++ b/doc/xml/atan_8c.xml
@@ -4,26 +4,26 @@
atan.c
math.h
-
+
-
+
-
+
-
+
-
+
-
+
-
+
diff --git a/doc/xml/atkbd_8c.xml b/doc/xml/atkbd_8c.xml
index 44ed4ea..a6513d6 100644
--- a/doc/xml/atkbd_8c.xml
+++ b/doc/xml/atkbd_8c.xml
@@ -18,230 +18,218 @@
ubixos/kpanic.h
ubixos/vitals.h
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
-
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
-
-
-
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
-
-
-
-
-
-
+
-
+
-
+
-
+
-
+
-
+
-
+
diff --git a/doc/xml/atkbd_8h.xml b/doc/xml/atkbd_8h.xml
index ce0c394..23a3da2 100644
--- a/doc/xml/atkbd_8h.xml
+++ b/doc/xml/atkbd_8h.xml
@@ -5,26 +5,26 @@
src/sys/include/ubixos/init.h
src/sys/isa/atkbd.c
-
+
-
+
-
+
-
+
-
+
-
+
-
+
diff --git a/doc/xml/bcopy_8c.xml b/doc/xml/bcopy_8c.xml
index 01beaf5..874b821 100644
--- a/doc/xml/bcopy_8c.xml
+++ b/doc/xml/bcopy_8c.xml
@@ -7,45 +7,45 @@
string.h
src/sys/lib/memcpy.c
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
diff --git a/doc/xml/bioscall_8c.xml b/doc/xml/bioscall_8c.xml
index 5d99509..8aeb844 100644
--- a/doc/xml/bioscall_8c.xml
+++ b/doc/xml/bioscall_8c.xml
@@ -11,156 +11,148 @@
sys/video.h
assert.h
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
-
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
-
-
-
-
-
-
+
-
+
-
+
-
+
diff --git a/doc/xml/bioscall_8h.xml b/doc/xml/bioscall_8h.xml
index 2073b10..aefcdf6 100644
--- a/doc/xml/bioscall_8h.xml
+++ b/doc/xml/bioscall_8h.xml
@@ -6,37 +6,37 @@
src/sys/kernel/bioscall.c
src/sys/kernel/systemtask.c
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
diff --git a/doc/xml/block_8c.xml b/doc/xml/block_8c.xml
index 1551f18..4238747 100644
--- a/doc/xml/block_8c.xml
+++ b/doc/xml/block_8c.xml
@@ -6,142 +6,134 @@
vfs/file.h
vfs/mount.h
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
-
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
-
-
-
-
-
-
+
-
+
-
+
-
+
-
+
-
+
diff --git a/doc/xml/buf_8h.xml b/doc/xml/buf_8h.xml
index 7896216..548192a 100644
--- a/doc/xml/buf_8h.xml
+++ b/doc/xml/buf_8h.xml
@@ -7,98 +7,98 @@
sys/device.h
src/sys/ufs/ffs.c
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
diff --git a/doc/xml/cdefs_8h.xml b/doc/xml/cdefs_8h.xml
index a4031ae..c147c45 100644
--- a/doc/xml/cdefs_8h.xml
+++ b/doc/xml/cdefs_8h.xml
@@ -5,32 +5,32 @@
ubixos/types.h
src/sys/lib/strtol.c
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
diff --git a/doc/xml/classogDisplay__UbixOS.xml b/doc/xml/classogDisplay__UbixOS.xml
index 096aa53..1ff95c0 100644
--- a/doc/xml/classogDisplay__UbixOS.xml
+++ b/doc/xml/classogDisplay__UbixOS.xml
@@ -366,21 +366,21 @@
-
+
-
+
-
+
VESAInfo
-
+
modeInfo
-
+
diff --git a/doc/xml/copyvirtualspace_8c.xml b/doc/xml/copyvirtualspace_8c.xml
index 54847bc..90c80c4 100644
--- a/doc/xml/copyvirtualspace_8c.xml
+++ b/doc/xml/copyvirtualspace_8c.xml
@@ -8,90 +8,90 @@
ubixos/kpanic.h
string.h
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
@@ -114,7 +114,7 @@
adjustCowCounter
cvsSpinLock
- kpanic
+ kpanic
memset
PAGE_COW
PAGE_DEFAULT
diff --git a/doc/xml/createvirtualspace_8c.xml b/doc/xml/createvirtualspace_8c.xml
index 2e0174d..7871a2b 100644
--- a/doc/xml/createvirtualspace_8c.xml
+++ b/doc/xml/createvirtualspace_8c.xml
@@ -4,58 +4,58 @@
createvirtualspace.c
vmm/vmm.h
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
@@ -83,7 +83,7 @@
vmm_getPhysicalAddr
vmmGetFreePage
vmmUnmapPage
- execFile
+ execFile
diff --git a/doc/xml/devfs_8c.xml b/doc/xml/devfs_8c.xml
index 78bf422..2e4983d 100644
--- a/doc/xml/devfs_8c.xml
+++ b/doc/xml/devfs_8c.xml
@@ -12,134 +12,134 @@
lib/string.h
lib/kprintf.h
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
diff --git a/doc/xml/devfs_8h.xml b/doc/xml/devfs_8h.xml
index 9bbf115..e217e03 100644
--- a/doc/xml/devfs_8h.xml
+++ b/doc/xml/devfs_8h.xml
@@ -9,79 +9,79 @@
src/sys/isa/fdc.c
src/sys/pci/hd.c
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
diff --git a/doc/xml/device_8c.xml b/doc/xml/device_8c.xml
index 3c56e27..b20400e 100644
--- a/doc/xml/device_8c.xml
+++ b/doc/xml/device_8c.xml
@@ -8,56 +8,56 @@
lib/kprintf.h
assert.h
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
diff --git a/doc/xml/device_8old_8h.xml b/doc/xml/device_8old_8h.xml
index e1c625c..7fa683b 100644
--- a/doc/xml/device_8old_8h.xml
+++ b/doc/xml/device_8old_8h.xml
@@ -6,52 +6,52 @@
src/sys/include/isa/ne2k.h
src/sys/isa/ne2k.c
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
diff --git a/doc/xml/dirCache_8c.xml b/doc/xml/dirCache_8c.xml
index 626c5b1..0e7025c 100644
--- a/doc/xml/dirCache_8c.xml
+++ b/doc/xml/dirCache_8c.xml
@@ -10,178 +10,170 @@
lib/string.h
ubixos/spinlock.h
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
-
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-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+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
diff --git a/doc/xml/directory_8c.xml b/doc/xml/directory_8c.xml
index ba862d9..52b130e 100644
--- a/doc/xml/directory_8c.xml
+++ b/doc/xml/directory_8c.xml
@@ -10,168 +10,160 @@
lib/kprintf.h
lib/string.h
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
-
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
-
-
-
-
-
-
+
-
+
-
+
-
+
-
+
-
+
diff --git a/doc/xml/divdi3_8c.xml b/doc/xml/divdi3_8c.xml
index 753ed54..1c58800 100644
--- a/doc/xml/divdi3_8c.xml
+++ b/doc/xml/divdi3_8c.xml
@@ -4,26 +4,26 @@
divdi3.c
math.h
-
+
-
+
-
+
-
+
-
+
-
+
-
+
diff --git a/doc/xml/dma_8c.xml b/doc/xml/dma_8c.xml
index 08e462b..e25f38b 100644
--- a/doc/xml/dma_8c.xml
+++ b/doc/xml/dma_8c.xml
@@ -6,33 +6,33 @@
sys/io.h
ubixos/types.h
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
diff --git a/doc/xml/dma_8h.xml b/doc/xml/dma_8h.xml
index 6de1ab2..48f426f 100644
--- a/doc/xml/dma_8h.xml
+++ b/doc/xml/dma_8h.xml
@@ -6,37 +6,37 @@
src/sys/isa/fdc.c
src/sys/sys/dma.c
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
diff --git a/doc/xml/driver_8h.xml b/doc/xml/driver_8h.xml
index 3945cff..6a97c40 100644
--- a/doc/xml/driver_8h.xml
+++ b/doc/xml/driver_8h.xml
@@ -4,20 +4,20 @@
driver.h
ubixos/types.h
-
+
-
+
-
+
-
+
-
+
diff --git a/doc/xml/elf_8c.xml b/doc/xml/elf_8c.xml
index 99e8ab2..171cd65 100644
--- a/doc/xml/elf_8c.xml
+++ b/doc/xml/elf_8c.xml
@@ -3,31 +3,195 @@
elf.c
ubixos/elf.h
+ ubixos/kpanic.h
+ lib/kmalloc.h
+ vmm/vmm.h
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
+
+
+
+
+
+
-
+
-
+
-
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ int
+ int elf_loadfile
+ (kTask_t *p, const char *file, u_int32_t *addr, u_int32_t *entry)
+ elf_loadfile
+
+ [kTask_t] *
+ p
+
+
+ const char *
+ file
+
+
+ [u_int32_t] *
+ addr
+
+
+ [u_int32_t] *
+ entry
+
+
+
+
+
+
+
+
+ _current
+ elfHeader::eEntry
+ elfHeader::eIdent
+ elfHeader::ePhnum
+ elfHeader::ePhoff
+ ET_DYN
+ ET_EXEC
+ elfHeader::eType
+ fclose
+ fopen
+ fread
+ fseek
+ taskStruct::id
+ K_PANIC
+ kfree
+ kmalloc
+ kprintf
+ memset
+ PAGE_DEFAULT
+ PAGE_PRESENT
+ PAGE_USER
+ elfProgramHeader::phMemsz
+ elfProgramHeader::phVaddr
+ PT_LOAD
+ vmm_remapPage
+ vmm_setPageAttributes
+ vmmFindFreePage
+ x1000
+
char *
char* elfGetPhType
@@ -43,9 +207,9 @@
-
+
elfPhType
- phTypeName
+ phTypeName
char *
@@ -62,9 +226,9 @@
-
+
elfRelType
- relTypeName
+ relTypeName
kmod_load
ldEnable
@@ -83,9 +247,9 @@
-
+
elfShType
- shTypeName
+ shTypeName
@@ -100,8 +264,8 @@
-
- elfGetPhType
+
+ elfGetPhType
@6
@@ -114,8 +278,8 @@
-
- elfGetRelType
+
+ elfGetRelType
@5
@@ -128,8 +292,8 @@
-
- elfGetShType
+
+ elfGetShType
@3
@@ -142,7 +306,7 @@
-
+
char *
@@ -155,7 +319,7 @@
-
+
[uInt32]
@@ -168,7 +332,7 @@
-
+
[uInt32]
@@ -181,7 +345,7 @@
-
+
[uInt32]
@@ -194,7 +358,7 @@
-
+
[uInt32]
@@ -207,7 +371,7 @@
-
+
char *
@@ -220,8 +384,8 @@
-
- elfGetPhType
+
+ elfGetPhType
char *
@@ -234,8 +398,8 @@
-
- elfGetRelType
+
+ elfGetRelType
char *
@@ -248,8 +412,8 @@
-
- elfGetShType
+
+ elfGetShType
@@ -287,87 +451,166 @@
#include<[ubixos/elf.h]>
-
-conststruct{
-char*[elfTypeName];
-[uInt32][id];
-}[elfType][]={
-{"ET_NONE",0},
-{"ET_REL",1},
-{"ET_EXEC",2},
-{"ET_DYN",3},
-{"ET_CORE",4},
-{"ET_LOPROC",0xff00},
-{"ET_HIPROC",0xffff},
-};
-
-conststruct{
-char*[phTypeName];
-[uInt32][id];
-}[elfPhType][]={
-{"PT_NULL",0},
-{"PT_LOAD",1},
-{"PT_DYNAMIC",2},
-{"PT_INTERP",3},
-{"PT_NOTE",4},
-{"PT_SHLIB",5},
-{"PT_PHDR",6},
-{"PT_LOPROC",0x70000000},
-{"PT_HIPROC",0x7fffffff},
-};
-
-conststruct{
-char*[shTypeName];
-[uInt32][id];
-}[elfShType][]={
-{"SHT_NULL",0},
-{"SHT_PROGBITS",1},
-{"SHT_SYMTAB",2},
-{"SHT_STRTAB",3},
-{"SHT_RELA",4},
-{"SHT_HASH",5},
-{"SHT_DYNAMIC",6},
-{"SHT_NOTE",7},
-{"SHT_NOBITS",8},
-{"SHT_REL",9},
-{"SHT_SHLIB",10},
-{"SHT_DYNSYM",11},
-};
-
-conststruct{
-char*[relTypeName];
-[uInt32][id];
-}[elfRelType][]={
-{"R_386_NONE",0},
-{"R_386_32",1},
-{"R_386_PC32",2},
-{"R_386_GOT32",3},
-{"R_386_PLT32",4},
-{"R_386_COPY",5},
-{"R_386_GLOB_DAT",6},
-{"R_386_JMP_SLOT",7},
-{"R_386_RELATIVE",8},
-{"R_386_GOTOFF",9},
-{"R_386_GOTPC",10},
-};
-
-
-char*[elfGetShType](intshType){
-return((char*)[elfShType][shType].[shTypeName]);
-}
-
-char*[elfGetPhType](intphType){
-return((char*)[elfPhType][phType].[phTypeName]);
-}
-
-char*[elfGetRelType](intrelType){
-return((char*)[elfRelType][relType].[relTypeName]);
-}
-
-
-
-
-
+#include<[ubixos/kpanic.h]>
+#include<[lib/kmalloc.h]>
+#include<[vmm/vmm.h]>
+
+conststruct{
+char*[elfTypeName];
+[uInt32][id];
+}[elfType][]={
+{"ET_NONE",0},
+{"ET_REL",1},
+{"ET_EXEC",2},
+{"ET_DYN",3},
+{"ET_CORE",4},
+{"ET_LOPROC",0xff00},
+{"ET_HIPROC",0xffff},
+};
+
+conststruct{
+char*[phTypeName];
+[uInt32][id];
+}[elfPhType][]={
+{"PT_NULL",0},
+{"PT_LOAD",1},
+{"PT_DYNAMIC",2},
+{"PT_INTERP",3},
+{"PT_NOTE",4},
+{"PT_SHLIB",5},
+{"PT_PHDR",6},
+{"PT_LOPROC",0x70000000},
+{"PT_HIPROC",0x7fffffff},
+};
+
+conststruct{
+char*[shTypeName];
+[uInt32][id];
+}[elfShType][]={
+{"SHT_NULL",0},
+{"SHT_PROGBITS",1},
+{"SHT_SYMTAB",2},
+{"SHT_STRTAB",3},
+{"SHT_RELA",4},
+{"SHT_HASH",5},
+{"SHT_DYNAMIC",6},
+{"SHT_NOTE",7},
+{"SHT_NOBITS",8},
+{"SHT_REL",9},
+{"SHT_SHLIB",10},
+{"SHT_DYNSYM",11},
+};
+
+conststruct{
+char*[relTypeName];
+[uInt32][id];
+}[elfRelType][]={
+{"R_386_NONE",0},
+{"R_386_32",1},
+{"R_386_PC32",2},
+{"R_386_GOT32",3},
+{"R_386_PLT32",4},
+{"R_386_COPY",5},
+{"R_386_GLOB_DAT",6},
+{"R_386_JMP_SLOT",7},
+{"R_386_RELATIVE",8},
+{"R_386_GOTOFF",9},
+{"R_386_GOTPC",10},
+};
+
+
+char*[elfGetShType](intshType){
+return((char*)[elfShType][shType].[shTypeName]);
+}
+
+char*[elfGetPhType](intphType){
+return((char*)[elfPhType][phType].[phTypeName]);
+}
+
+char*[elfGetRelType](intrelType){
+return((char*)[elfRelType][relType].[relTypeName]);
+}
+
+int[elf_loadfile]([kTask_t]*p,constchar*[file],[u_int32_t]*addr,[u_int32_t]*entry){
+inti=0x0;
+intx=0x0;
+intnumsegs=0x0;
+[u_int32_t]base=0x0;
+[u_int32_t]base_addr=0x0;
+[elfHeader]*binaryHeader=0x0;
+[elfProgramHeader]*programHeader=0x0;
+[fileDescriptor]*exec_fd=0x0;
+
+exec_fd=[fopen](file,"r");
+if(exec_fd==0x0)
+return(-1);
+[kprintf]("MOO");
+
+if((binaryHeader=([elfHeader]*)[kmalloc](sizeof([elfHeader])))==0x0)
+[K_PANIC]("mallocfailed!");
+[fread](binaryHeader,sizeof(elfHeader),1,exec_fd);
+
+
+if((binaryHeader->[eIdent][1]!='E')&&(binaryHeader->[eIdent][2]!='L')&&(binaryHeader->[eIdent][3]!='F')){
+[kfree](binaryHeader);
+[fclose](exec_fd);
+return(-1);
+}
+
+if(binaryHeader->[eType]==[ET_DYN])
+base=*addr;
+elseif(binaryHeader->[eType]==[ET_EXEC])
+base=0x0;
+else
+return(-1);
+
+
+if((programHeader=([elfProgramHeader]*)[kmalloc](sizeof([elfProgramHeader])*binaryHeader->[ePhnum]))==0x0)
+[K_PANIC]("mallocfailed!");
+[fseek](exec_fd,binaryHeader->[ePhoff],0);
+[fread](programHeader,(sizeof(elfProgramHeader)*binaryHeader->[ePhnum]),1,exec_fd);
+[kprintf]("MEW:[0x%X]",base);
+for(i=0x0;i<binaryHeader->[ePhnum];i++){
+switch(programHeader[i].phType){
+case[PT_LOAD]:
+
+
+
+
+for(x=0x0;x<(programHeader[i].[phMemsz]);x+=0x1000){
+
+if([vmm_remapPage]([vmmFindFreePage]([_current]->[id]),((programHeader[i].[phVaddr]&0xFFFFF000)+x+base),[PAGE_DEFAULT])==0x0)
+[K_PANIC]("Error:RemapPageFailed");
+[memset]((void*)((programHeader[i].phVaddr&0xFFFFF000)+x+base),0x0,0[x1000]);
+}
+
+
+[fseek](exec_fd,programHeader[i].phOffset,0);
+[fread]((void*)programHeader[i].phVaddr,programHeader[i].phFilesz,1,exec_fd);
+
+if((programHeader[i].phFlags&0x2)!=0x2){
+for(x=0x0;x<(programHeader[i].[phMemsz]);x+=0x1000){
+if(([vmm_setPageAttributes]((programHeader[i].phVaddr&0xFFFFF000)+x+base,[PAGE_PRESENT]|[PAGE_USER]))!=0x0)
+[K_PANIC]("vmm_setPageAttributesfailed");
+}
+}
+if(numsegs==0x0)
+base_addr=(programHeader[i].phVaddr&0xFFFFF000)+base;
+numsegs++;
+break;
+}
+}
+*addr=base_addr;
+[kprintf]("entry:[0x%X]\n",*entry);
+*entry=binaryHeader->[eEntry]+base;
+[kprintf]("entry:[0x%X]\n",*entry);
+return(0x0);
+}
+
+
+
+
+
diff --git a/doc/xml/elf_8h.xml b/doc/xml/elf_8h.xml
index 6ed2632..8589c7d 100644
--- a/doc/xml/elf_8h.xml
+++ b/doc/xml/elf_8h.xml
@@ -3,405 +3,123 @@
elf.h
ubixos/types.h
- src/sys/include/ubixos/sched.h
+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 @@
-
+
kmod_load
ldEnable
@@ -446,7 +164,7 @@
-
+
kmod_load
ldEnable
@@ -459,7 +177,7 @@
-
+
elfLibrary
@@ -470,7 +188,7 @@
-
+
EM_386
@@ -481,7 +199,7 @@
-
+
EM_68K
@@ -492,7 +210,7 @@
-
+
EM_860
@@ -503,7 +221,7 @@
-
+
EM_88K
@@ -514,7 +232,7 @@
-
+
EM_M32
@@ -525,7 +243,7 @@
-
+
EM_MIPS
@@ -536,7 +254,7 @@
-
+
EM_NONE
@@ -547,7 +265,7 @@
-
+
EM_SPARC
@@ -558,7 +276,7 @@
-
+
ET_CORE
@@ -569,7 +287,7 @@
-
+
ET_DYN
@@ -580,7 +298,8 @@
-
+
+ elf_loadfile
ET_EXEC
@@ -591,7 +310,9 @@
-
+
+ elf_loadfile
+ sys_exec
ET_HIPROC
@@ -602,7 +323,7 @@
-
+
ET_LOPROC
@@ -613,7 +334,7 @@
-
+
ET_NONE
@@ -624,7 +345,7 @@
-
+
ET_REL
@@ -635,7 +356,7 @@
-
+
EV_CURRENT
@@ -646,7 +367,7 @@
-
+
EV_NONE
@@ -657,7 +378,7 @@
-
+
PT_DYNAMIC
@@ -668,10 +389,10 @@
-
+
kmod_load
ldEnable
- sysExec
+ sysExec
PT_GNU_EH_FRAME
@@ -682,7 +403,7 @@
-
+
PT_GNU_RELRO
@@ -693,7 +414,7 @@
-
+
PT_GNU_STACK
@@ -704,7 +425,7 @@
-
+
kmod_load
ldEnable
@@ -717,7 +438,7 @@
-
+
PT_HIPROC
@@ -728,7 +449,7 @@
-
+
PT_INTERP
@@ -739,8 +460,9 @@
-
- sysExec
+
+ sys_exec
+ sysExec
PT_LOAD
@@ -751,10 +473,12 @@
-
+
+ elf_loadfile
kmod_load
ldEnable
- sysExec
+ sys_exec
+ sysExec
PT_LOOS
@@ -765,7 +489,7 @@
-
+
PT_LOPROC
@@ -776,7 +500,7 @@
-
+
PT_NOTE
@@ -787,7 +511,7 @@
-
+
PT_NULL
@@ -798,7 +522,7 @@
-
+
PT_PAX_FLAGS
@@ -809,7 +533,7 @@
-
+
kmod_load
ldEnable
@@ -822,7 +546,8 @@
-
+
+ sys_exec
PT_SHLIB
@@ -833,7 +558,7 @@
-
+
R_386_32
@@ -844,7 +569,7 @@
-
+
kmod_load
ldEnable
@@ -857,7 +582,7 @@
-
+
R_386_GLOB_DAT
@@ -868,7 +593,7 @@
-
+
R_386_GOT32
@@ -879,7 +604,7 @@
-
+
R_386_GOTOFF
@@ -890,7 +615,7 @@
-
+
R_386_GOTPC
@@ -901,7 +626,7 @@
-
+
R_386_JMP_SLOT
@@ -912,7 +637,7 @@
-
+
R_386_NONE
@@ -923,7 +648,7 @@
-
+
R_386_PC32
@@ -934,7 +659,7 @@
-
+
kmod_load
ldEnable
@@ -947,7 +672,7 @@
-
+
R_386_RELATIVE
@@ -958,12 +683,69 @@
-
+
kmod_load
ldEnable
+
+ int
+ int elf_loadfile
+ (kTask_t *p, const char *file, u_int32_t *addr, u_int32_t *entry)
+ elf_loadfile
+
+ [kTask_t] *
+ p
+
+
+ const char *
+ file
+
+
+ [u_int32_t] *
+ addr
+
+
+ [u_int32_t] *
+ entry
+
+
+
+
+
+
+
+
+ _current
+ elfHeader::eEntry
+ elfHeader::eIdent
+ elfHeader::ePhnum
+ elfHeader::ePhoff
+ ET_DYN
+ ET_EXEC
+ elfHeader::eType
+ fclose
+ fopen
+ fread
+ fseek
+ taskStruct::id
+ K_PANIC
+ kfree
+ kmalloc
+ kprintf
+ memset
+ PAGE_DEFAULT
+ PAGE_PRESENT
+ PAGE_USER
+ elfProgramHeader::phMemsz
+ elfProgramHeader::phVaddr
+ PT_LOAD
+ vmm_remapPage
+ vmm_setPageAttributes
+ vmmFindFreePage
+ x1000
+
char *
char* elfGetPhType
@@ -978,9 +760,9 @@
-
+
elfPhType
- phTypeName
+ phTypeName
char *
@@ -996,9 +778,9 @@
-
+
elfRelType
- relTypeName
+ relTypeName
kmod_load
ldEnable
@@ -1016,9 +798,9 @@
-
+
elfShType
- shTypeName
+ shTypeName
@@ -1059,165 +841,182 @@
#define_ELF_H
#include<[ubixos/types.h]>
-
-#defineelfExecutable0x002
-#defineelfLibrary0x003
-
-#defineR_386_NONE0
-#defineR_386_321
-#defineR_386_PC322
-#defineR_386_GOT323
-#defineR_386_PLT324
-#defineR_386_COPY5
-#defineR_386_GLOB_DAT6
-#defineR_386_JMP_SLOT7
-#defineR_386_RELATIVE8
-#defineR_386_GOTOFF9
-#defineR_386_GOTPC10
-
+#include<[ubixos/sched.h]>
+
+#defineelfExecutable0x002
+#defineelfLibrary0x003
+
+#defineR_386_NONE0
+#defineR_386_321
+#defineR_386_PC322
+#defineR_386_GOT323
+#defineR_386_PLT324
+#defineR_386_COPY5
+#defineR_386_GLOB_DAT6
+#defineR_386_JMP_SLOT7
+#defineR_386_RELATIVE8
+#defineR_386_GOTOFF9
+#defineR_386_GOTPC10
-
-#defineET_NONE0//Nofiletype
-#defineET_REL1//Relocatablefile
-#defineET_EXEC2//Executablefile
-#defineET_DYN3//Sharedobjectfile
-#defineET_CORE4//Corefile
-#defineET_LOPROC0xff00//Processor-specific
-#defineET_HIPROC0xffff
-
-
-
-#defineEM_NONE0//Nomachine
-#defineEM_M321//AT&TWE32100
-#defineEM_SPARC2//SPARC
-#defineEM_3863//Intel80386
-#defineEM_68K4//Motorola68000
-#defineEM_88K5//Motorola88000
-#defineEM_8607//Intel80860
-#defineEM_MIPS8//MIPSRS3000
-
-
-
-#defineEV_NONE0//Invalidversion
-#defineEV_CURRENT1//Currentversion
-
-
-
-#definePT_NULL0
-#definePT_LOAD1
-#definePT_DYNAMIC2
-#definePT_INTERP3
-#definePT_NOTE4
-#definePT_SHLIB5
-#definePT_PHDR6
-#definePT_LOOS0x60000000
-#definePT_HIOS0x6fffffff
-#definePT_LOPROC0x70000000
-#definePT_HIPROC0x7fffffff
-#definePT_GNU_EH_FRAME0x6474e550
-#definePT_GNU_STACK(PT_LOOS+0x474e551)
-#definePT_GNU_RELRO(PT_LOOS+0x474e552)
-#definePT_PAX_FLAGS(PT_LOOS+0x5041580)
-
-
-
-typedefstruct{
-[uInt8]eIdent[16];
-[uInt16]eType;
-[uInt16]eMachine;
-[uInt32]eVersion;
-[uInt32]eEntry;
-[uInt32]ePhoff;
-[uInt32]eShoff;
-[uInt32]eFlags;
-[uInt16]eEhsize;
-[uInt16]ePhentsize;
-[uInt16]ePhnum;
-[uInt16]eShentsize;
-[uInt16]eShnum;
-[uInt16]eShstrndx;
-}[elfHeader];
-
-typedefstruct{
-[uInt32]phType;
-[uInt32]phOffset;
-[uInt32]phVaddr;
-[uInt32]phPaddr;
-[uInt32]phFilesz;
-[uInt32]phMemsz;
-[uInt32]phFlags;
-[uInt32]phAlign;
-}[elfProgramHeader];
-
-typedefstruct{
-[uInt32]shName;
-[uInt32]shType;
-[uInt32]shFlags;
-[uInt32]shAddr;
-[uInt32]shOffset;
-[uInt32]shSize;
-[uInt32]shLink;
-[uInt32]shInfo;
-[uInt32]shAddralign;
-[uInt32]shEntsize;
-}[elfSectionHeader];
-
-typedefstruct{
-[uInt32]pltOffset;
-[uInt32]pltInfo;
-}[elfPltInfo];
-
-typedefstruct{
-[uInt32]dynName;
-[uInt32]dynValue;
-[uInt32]dynSize;
-[uInt32]dynInfo;
-}[elfDynSym];
-
-typedefstruct{
-[uInt32]dynVal;
-[uInt32]dynPtr;
-}[elfDynamic];
-
-char*[elfGetShType](int);
-char*[elfGetPhType](int);
-char*[elfGetRelType](int);
-
-#defineELF32_R_SYM(i)((i)>>8)
-#defineELF32_R_TYPE(i)((unsignedchar)(i))
-#defineELF32_R_INFO(s,t)((s)<<8+(unsignedchar)(t))
-
-#endif
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+#defineET_NONE0//Nofiletype
+#defineET_REL1//Relocatablefile
+#defineET_EXEC2//Executablefile
+#defineET_DYN3//Sharedobjectfile
+#defineET_CORE4//Corefile
+#defineET_LOPROC0xff00//Processor-specific
+#defineET_HIPROC0xffff
+
+
+
+#defineEM_NONE0//Nomachine
+#defineEM_M321//AT&TWE32100
+#defineEM_SPARC2//SPARC
+#defineEM_3863//Intel80386
+#defineEM_68K4//Motorola68000
+#defineEM_88K5//Motorola88000
+#defineEM_8607//Intel80860
+#defineEM_MIPS8//MIPSRS3000
+
+
+
+#defineEV_NONE0//Invalidversion
+#defineEV_CURRENT1//Currentversion
+
+
+
+#definePT_NULL0
+#definePT_LOAD1
+#definePT_DYNAMIC2
+#definePT_INTERP3
+#definePT_NOTE4
+#definePT_SHLIB5
+#definePT_PHDR6
+#definePT_LOOS0x60000000
+#definePT_HIOS0x6fffffff
+#definePT_LOPROC0x70000000
+#definePT_HIPROC0x7fffffff
+#definePT_GNU_EH_FRAME0x6474e550
+#definePT_GNU_STACK(PT_LOOS+0x474e551)
+#definePT_GNU_RELRO(PT_LOOS+0x474e552)
+#definePT_PAX_FLAGS(PT_LOOS+0x5041580)
+
+
+
+typedefstruct{
+[uInt8]eIdent[16];
+[uInt16]eType;
+[uInt16]eMachine;
+[uInt32]eVersion;
+[uInt32]eEntry;
+[uInt32]ePhoff;
+[uInt32]eShoff;
+[uInt32]eFlags;
+[uInt16]eEhsize;
+[uInt16]ePhentsize;
+[uInt16]ePhnum;
+[uInt16]eShentsize;
+[uInt16]eShnum;
+[uInt16]eShstrndx;
+}[elfHeader];
+
+typedefstruct{
+[uInt32]phType;
+[uInt32]phOffset;
+[uInt32]phVaddr;
+[uInt32]phPaddr;
+[uInt32]phFilesz;
+[uInt32]phMemsz;
+[uInt32]phFlags;
+[uInt32]phAlign;
+}[elfProgramHeader];
+
+typedefstruct{
+[uInt32]shName;
+[uInt32]shType;
+[uInt32]shFlags;
+[uInt32]shAddr;
+[uInt32]shOffset;
+[uInt32]shSize;
+[uInt32]shLink;
+[uInt32]shInfo;
+[uInt32]shAddralign;
+[uInt32]shEntsize;
+}[elfSectionHeader];
+
+typedefstruct{
+[uInt32]pltOffset;
+[uInt32]pltInfo;
+}[elfPltInfo];
+
+typedefstruct{
+[uInt32]dynName;
+[uInt32]dynValue;
+[uInt32]dynSize;
+[uInt32]dynInfo;
+}[elfDynSym];
+
+typedefstruct{
+[uInt32]dynVal;
+[uInt32]dynPtr;
+}[elfDynamic];
+
+typedefstruct{
+[int32_t]execfd;
+[u_int32_t]phdr;
+[u_int32_t]phent;
+[u_int32_t]phnum;
+[u_int32_t]pagesz;
+[u_int32_t]base;
+[u_int32_t]flags;
+[u_int32_t]entry;
+[u_int32_t]trace;
+}[Elf_Auxargs];
+
+char*[elfGetShType](int);
+char*[elfGetPhType](int);
+char*[elfGetRelType](int);
+int[elf_loadfile]([kTask_t]*p,constchar*[file],[u_int32_t]*addr,[u_int32_t]*entry);
+
+#defineELF32_R_SYM(i)((i)>>8)
+#defineELF32_R_TYPE(i)((unsignedchar)(i))
+#defineELF32_R_INFO(s,t)((s)<<8+(unsignedchar)(t))
+
+#endif
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/doc/xml/endtask_8c.xml b/doc/xml/endtask_8c.xml
index 3a1ba53..ffc8cfc 100644
--- a/doc/xml/endtask_8c.xml
+++ b/doc/xml/endtask_8c.xml
@@ -9,184 +9,172 @@
lib/kprintf.h
isa/8259.h
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
-
-
+
-
+
-
+
-
-
-
-
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
-
-
-
-
-
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
@@ -225,7 +213,7 @@
_int6
_int9
schedEndTask
- sysExec
+ sysExec
sysExit
vmm_pageFault
diff --git a/doc/xml/endtask_8h.xml b/doc/xml/endtask_8h.xml
index 51f1834..126c248 100644
--- a/doc/xml/endtask_8h.xml
+++ b/doc/xml/endtask_8h.xml
@@ -14,143 +14,135 @@
src/sys/kernel/syscall_new.c
src/sys/sys/idt.c
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
-
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
-
-
-
-
-
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
@@ -189,7 +181,7 @@
_int6
_int9
schedEndTask
- sysExec
+ sysExec
sysExit
vmm_pageFault
diff --git a/doc/xml/ethernetif_8h.xml b/doc/xml/ethernetif_8h.xml
index 4a1366a..c016c1d 100644
--- a/doc/xml/ethernetif_8h.xml
+++ b/doc/xml/ethernetif_8h.xml
@@ -4,13 +4,13 @@
ethernetif.h
net/netif.h
-
+
-
+
-
+
diff --git a/doc/xml/exec_8c.xml b/doc/xml/exec_8c.xml
index 9b27a37..8fb0b0f 100644
--- a/doc/xml/exec_8c.xml
+++ b/doc/xml/exec_8c.xml
@@ -3,7 +3,7 @@
exec.c
ubixos/exec.h
- ubixos/sched.h
+ ubixos/elf.h
ubixos/ld.h
ubixos/kpanic.h
ubixos/endtask.h
@@ -13,180 +13,180 @@
lib/string.h
assert.h
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
-
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
+
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
@@ -200,9 +200,9 @@
-
- execFile
- sysExec
+
+ execFile
+ sysExec
@@ -233,7 +233,7 @@
-
+
_current
assert
tssStruct::back_link
@@ -242,19 +242,19 @@
tssStruct::ds
tssStruct::ebp
tssStruct::edi
- elfHeader::eEntry
+ elfHeader::eEntry
tssStruct::eflags
- elfHeader::eIdent
+ elfHeader::eIdent
tssStruct::eip
- elfHeader::ePhnum
- elfHeader::ePhoff
+ elfHeader::ePhnum
+ elfHeader::ePhoff
tssStruct::es
tssStruct::esi
tssStruct::esp
tssStruct::esp0
tssStruct::esp1
tssStruct::esp2
- elfHeader::eType
+ elfHeader::eType
fclose
fopen
fread
@@ -269,7 +269,7 @@
kernelPageDirectory
kfree
kmalloc
- kpanic
+ kpanic
kprintf
tssStruct::ldt
memset
@@ -280,8 +280,8 @@
PAGE_STACK
PAGE_USER
fileDescriptorStruct::perms
- elfProgramHeader::phMemsz
- elfProgramHeader::phVaddr
+ elfProgramHeader::phMemsz
+ elfProgramHeader::phVaddr
READY
sched_setStatus
schedNewTask
@@ -289,7 +289,7 @@
tssStruct::ss0
tssStruct::ss1
tssStruct::ss2
- STACK_ADDR
+ STACK_ADDR
taskStruct::td
taskStruct::term
tssStruct::trace_bitmap
@@ -330,7 +330,7 @@
-
+
assert
tssStruct::back_link
tssStruct::cr3
@@ -352,7 +352,7 @@
taskStruct::imageFd
tssStruct::io_map
kernelPageDirectory
- kpanic
+ kpanic
tssStruct::ldt
taskStruct::oInfo
READY
@@ -368,6 +368,68 @@
kmain
ubthread_create
+
+ void
+ void sys_exec
+ (char *file, char *ap)
+ sys_exec
+
+ char *
+ file
+
+
+ char *
+ ap
+
+
+New exec...
+
+
+
+Clean the virtual of COW pages left over from the forkAdjust iframebuild argc and argv[]Start of Env
+
+ _current
+ elfHeader::eEntry
+ elfHeader::eIdent
+ i386_frame::eip
+ elfHeader::ePhnum
+ elfHeader::ePhoff
+ ET_EXEC
+ elfHeader::eType
+ fclose
+ fopen
+ fread
+ fseek
+ taskStruct::id
+ taskStruct::imageFd
+ K_PANIC
+ kfree
+ kmalloc
+ kprintf
+ memset
+ taskStruct::oInfo
+ PAGE_DEFAULT
+ PAGE_PRESENT
+ PAGE_SHIFT
+ PAGE_USER
+ elfProgramHeader::phMemsz
+ elfProgramHeader::phOffset
+ elfProgramHeader::phVaddr
+ PT_INTERP
+ PT_LOAD
+ PT_PHDR
+ round_page
+ taskStruct::td
+ trunc_page
+ thread::vm_daddr
+ thread::vm_dsize
+ vmm_remapPage
+ vmm_setPageAttributes
+ vmmFindFreePage
+ osInfo::vmStart
+ x1000
+ sysExec
+
void
void sysExec
@@ -387,20 +449,20 @@
Clean the virtual of COW pages left over from the forkAdjust iframebuild argc and argv[]
-
+
_current
assert
i386_frame::ebp
- elfHeader::eEntry
- elfHeader::eIdent
+ elfHeader::eEntry
+ elfHeader::eIdent
i386_frame::eip
endTask
- elfHeader::ePhnum
- elfHeader::ePhoff
- elfHeader::eShnum
- elfHeader::eShoff
+ elfHeader::ePhnum
+ elfHeader::ePhoff
+ elfHeader::eShnum
+ elfHeader::eShoff
tssStruct::esp0
- elfHeader::eType
+ elfHeader::eType
fclose
fopen
fread
@@ -410,7 +472,7 @@
K_PANIC
kfree
kmalloc
- kpanic
+ kpanic
kprintf
ldEnable
memset
@@ -421,15 +483,16 @@
PAGE_SIZE
PAGE_USER
fileDescriptorStruct::perms
- elfProgramHeader::phMemsz
- elfProgramHeader::phVaddr
- PT_DYNAMIC
- PT_INTERP
- PT_LOAD
+ elfProgramHeader::phMemsz
+ elfProgramHeader::phVaddr
+ PT_DYNAMIC
+ PT_INTERP
+ PT_LOAD
round_page
- STACK_ADDR
+ STACK_ADDR
strcpy
strlen
+ sys_exec
taskStruct::td
trunc_page
taskStruct::tss
@@ -468,526 +531,698 @@
-
-
-
-
-
-
-
-
-
-
-
-
-#include<[ubixos/exec.h]>
-#include<[ubixos/sched.h]>
-#include<[ubixos/ld.h]>
-#include<[ubixos/kpanic.h]>
-#include<[ubixos/endtask.h]>
-#include<[vmm/vmm.h]>
-#include<[lib/kmalloc.h]>
-#include<[lib/kprintf.h]>
-#include<[lib/string.h]>
-#include<[assert.h]>
-
-#defineSTACK_ADDR0xC800000
-
-
-
-
-
-
-
-
-
-
-
-
-[uInt32][execThread](void(*tproc)(void),[uInt32]stack,char*arg){
-[kTask_t]*newProcess=0x0;
-
-newProcess=[schedNewTask]();
-[assert](newProcess);
-if(stack<0x100000)
-[kpanic]("exec:stacknotinvalidarea:[0x%X]\n",stack);
-
-
-newProcess->[tss].[back_link]=0x0;
-newProcess->[tss].[esp0]=0x0;
-newProcess->[tss].[ss0]=0x0;
-newProcess->[tss].[esp1]=0x0;
-newProcess->[tss].[ss1]=0x0;
-newProcess->[tss].[esp2]=0x0;
-newProcess->[tss].[ss2]=0x0;
-newProcess->[tss].[cr3]=(unsignedint)[kernelPageDirectory];
-newProcess->[tss].[eip]=(unsignedint)tproc;
-newProcess->[tss].[eflags]=0x206;
-newProcess->[tss].[esp]=stack;
-newProcess->[tss].[ebp]=stack;
-newProcess->[tss].[esi]=0x0;
-newProcess->[tss].[edi]=0x0;
-
-
-
-
-
-
-
-
-
-
-
-newProcess->[tss].[es]=0x10;
-newProcess->[tss].[cs]=0x08;
-newProcess->[tss].[ss]=0x10;
-newProcess->[tss].[ds]=0x10;
-newProcess->[tss].[fs]=0x10;
-newProcess->[tss].[gs]=0x10;
-
-newProcess->[tss].[ldt]=0x18;
-newProcess->[tss].[trace_bitmap]=0x0000;
-newProcess->[tss].[io_map]=0x8000;
-newProcess->[oInfo].[vmStart]=0x6400000;
-
-newProcess->[imageFd]=0x0;
-
-
-asmvolatile(
-"pusha\n"
-"movl%%esp,%%ecx\n"
-"movl%1,%%eax\n"
-"movl%%eax,%%esp\n"
-"pushl%%ebx\n"
+
+
+
+
+
+
+
+
+
+
+
+
+
+#include<[ubixos/exec.h]>
+#include<[ubixos/elf.h]>
+#include<[ubixos/ld.h]>
+#include<[ubixos/kpanic.h]>
+#include<[ubixos/endtask.h]>
+#include<[vmm/vmm.h]>
+#include<[lib/kmalloc.h]>
+#include<[lib/kprintf.h]>
+#include<[lib/string.h]>
+#include<[assert.h]>
+
+#defineSTACK_ADDR0xC800000
+
+
+
+
+
+
+
+
+
+
+
+
+[uInt32][execThread](void(*tproc)(void),[uInt32]stack,char*arg){
+[kTask_t]*newProcess=0x0;
+
+newProcess=[schedNewTask]();
+[assert](newProcess);
+if(stack<0x100000)
+[kpanic]("exec:stacknotinvalidarea:[0x%X]\n",stack);
+
+
+newProcess->[tss].[back_link]=0x0;
+newProcess->[tss].[esp0]=0x0;
+newProcess->[tss].[ss0]=0x0;
+newProcess->[tss].[esp1]=0x0;
+newProcess->[tss].[ss1]=0x0;
+newProcess->[tss].[esp2]=0x0;
+newProcess->[tss].[ss2]=0x0;
+newProcess->[tss].[cr3]=(unsignedint)[kernelPageDirectory];
+newProcess->[tss].[eip]=(unsignedint)tproc;
+newProcess->[tss].[eflags]=0x206;
+newProcess->[tss].[esp]=stack;
+newProcess->[tss].[ebp]=stack;
+newProcess->[tss].[esi]=0x0;
+newProcess->[tss].[edi]=0x0;
+
+
+
+
+
+
+
+
+
+
+
+newProcess->[tss].[es]=0x10;
+newProcess->[tss].[cs]=0x08;
+newProcess->[tss].[ss]=0x10;
+newProcess->[tss].[ds]=0x10;
+newProcess->[tss].[fs]=0x10;
+newProcess->[tss].[gs]=0x10;
+
+newProcess->[tss].[ldt]=0x18;
+newProcess->[tss].[trace_bitmap]=0x0000;
+newProcess->[tss].[io_map]=0x8000;
+newProcess->[oInfo].[vmStart]=0x6400000;
+
+newProcess->[imageFd]=0x0;
+
+
+asmvolatile(
+"pusha\n"
+"movl%%esp,%%ecx\n"
+"movl%1,%%eax\n"
+"movl%%eax,%%esp\n"
"pushl%%ebx\n"
"pushl%%ebx\n"
-"movl%%esp,%%eax\n"
-"movl%%eax,%1\n"
-"movl%%ecx,%%esp\n"
-"popa\n"
-:
-:"b"(arg),"m"(newProcess->[tss].[esp])
-);
-
-
-[sched_setStatus](newProcess->[id],[READY]);
-
-
-return(([uInt32])newProcess);
-}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-void[execFile](char*[file],intargc,char**argv,intconsole){
-
-inti=0x0;
-intx=0x0;
-[u_int32_t]*tmp=0x0;
-
-[fileDescriptor]*tmpFd=0x0;
-[elfHeader]*binaryHeader=0x0;
-[elfProgramHeader]*programHeader=0x0;
-
-
-[_current]=[schedNewTask]();
-[assert]([_current]);
-[_current]->[gid]=0x0;
-[_current]->[uid]=0x0;
-[_current]->[term]=[tty_find](console);
-if([_current]->[term]==0x0)
-[kprintf]("Error:invalidconsole\n");
-
-
-[_current]->[term]->[owner]=[_current]->[id];
-
-
-[_current]->[tss].[cr3]=([uInt32])[vmmCreateVirtualSpace]([_current]->[id]);
-
-
-asmvolatile(
-"movl%0,%%eax\n"
-"movl%%eax,%%cr3\n"
-::"d"(([uInt32]*)([_current]->[tss].[cr3]))
-);
-
-
-tmpFd=[fopen](file,"r");
-
-
-if(tmpFd==0x0){
-[kprintf]("ExecFormatError:BinaryFileNotExecutable.\n");
-[fclose](tmpFd);
-return;
-}
-if(tmpFd->[perms]==0x0){
-[kprintf]("ExecFormatError:BinaryFileNotExecutable.\n");
-[fclose](tmpFd);
-return;
-}
-
-
-binaryHeader=([elfHeader]*)[kmalloc](sizeof([elfHeader]));
-
+"pushl%%ebx\n"
+"movl%%esp,%%eax\n"
+"movl%%eax,%1\n"
+"movl%%ecx,%%esp\n"
+"popa\n"
+:
+:"b"(arg),"m"(newProcess->[tss].[esp])
+);
+
+
+[sched_setStatus](newProcess->[id],[READY]);
+
+
+return(([uInt32])newProcess);
+}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+void[execFile](char*[file],intargc,char**argv,intconsole){
+
+inti=0x0;
+intx=0x0;
+[u_int32_t]*tmp=0x0;
+
+[fileDescriptor]*tmpFd=0x0;
+[elfHeader]*binaryHeader=0x0;
+[elfProgramHeader]*programHeader=0x0;
+
+
+[_current]=[schedNewTask]();
+[assert]([_current]);
+[_current]->[gid]=0x0;
+[_current]->[uid]=0x0;
+[_current]->[term]=[tty_find](console);
+if([_current]->[term]==0x0)
+[kprintf]("Error:invalidconsole\n");
+
+
+[_current]->[term]->[owner]=[_current]->[id];
+
+
+[_current]->[tss].[cr3]=([uInt32])[vmmCreateVirtualSpace]([_current]->[id]);
+
+
+asmvolatile(
+"movl%0,%%eax\n"
+"movl%%eax,%%cr3\n"
+::"d"(([uInt32]*)([_current]->[tss].[cr3]))
+);
+
+
+tmpFd=[fopen](file,"r");
+
+
+if(tmpFd==0x0){
+[kprintf]("ExecFormatError:BinaryFileNotExecutable.\n");
+[fclose](tmpFd);
+return;
+}
+if(tmpFd->[perms]==0x0){
+[kprintf]("ExecFormatError:BinaryFileNotExecutable.\n");
+[fclose](tmpFd);
+return;
+}
+
+
+binaryHeader=([elfHeader]*)[kmalloc](sizeof([elfHeader]));
-
-[fread](binaryHeader,sizeof(elfHeader),1,tmpFd);
-
+
+
+[fread](binaryHeader,sizeof(elfHeader),1,tmpFd);
-
-if((binaryHeader->[eIdent][1]!='E')&&(binaryHeader->[eIdent][2]!='L')&&(binaryHeader->[eIdent][3]!='F')){
-[kprintf]("ExecFormatError:BinaryFileNotExecutable.\n");
-[kfree](binaryHeader);
-[fclose](tmpFd);
-return;
-}
-elseif(binaryHeader->[eType]!=2){
-[kprintf]("ExecFormatError:BinaryFileNotExecutable.\n");
-[kfree](binaryHeader);
-[fclose](tmpFd);
-return;
-}
-elseif(binaryHeader->[eEntry]==0x300000){
-[kprintf]("ExecFormatError:BinaryFileNotExecutable.\n");
-[kfree](binaryHeader);
-[fclose](tmpFd);
-return;
-}
-
-
-programHeader=([elfProgramHeader]*)[kmalloc](sizeof([elfProgramHeader])*binaryHeader->[ePhnum]);
-[fseek](tmpFd,binaryHeader->[ePhoff],0);
-
-
-[fread](programHeader,(sizeof(elfProgramHeader)*binaryHeader->[ePhnum]),1,tmpFd);
-
-
-
-for(i=0;i<binaryHeader->[ePhnum];i++){
-if(programHeader[i].phType==1){
-
-
-
-
-for(x=0x0;x<(programHeader[i].[phMemsz]);x+=0x1000){
-
-if([vmm_remapPage]([vmmFindFreePage]([_current]->[id]),((programHeader[i].[phVaddr]&0xFFFFF000)+x),[PAGE_DEFAULT])==0x0)
-[K_PANIC]("RemapPageFailed");
-
-[memset]((void*)((programHeader[i].phVaddr&0xFFFFF000)+x),0x0,0[x1000]);
-}
-[_current]->[oInfo].[vmStart]=0x80000000;
-[_current]->[td].[vm_daddr]=(char*)(programHeader[i].phVaddr&0xFFFFF000);
-
-[fseek](tmpFd,programHeader[i].phOffset,0);
-[fread]((void*)programHeader[i].phVaddr,programHeader[i].phFilesz,1,tmpFd);
-if((programHeader[i].phFlags&0x2)!=0x2){
-[kprintf]("pH:[0x%X]\n",programHeader[i].phMemsz);
-for(x=0x0;x<(programHeader[i].[phMemsz]);x+=0x1000){
-if(([vmm_setPageAttributes]((programHeader[i].phVaddr&0xFFFFF000)+x,[PAGE_PRESENT]|[PAGE_USER]))!=0x0)
-[kpanic]("Error:vmm_setPageAttributesfailed,File:%s,Line:%i\n",__FILE__,__LINE__);
-}
-}
-}
-}
-
-
-[_current]->[oInfo].[vmStart]=0x80000000;
-[_current]->[td].[vm_daddr]=(char*)(programHeader[i].phVaddr&0xFFFFF000);
-
-
-for(x=1;x<100;x++){
-[vmm_remapPage]([vmmFindFreePage]([_current]->[id]),[STACK_ADDR]-(x*0[x1000]),[PAGE_DEFAULT]|[PAGE_STACK]);
-}
-
-
-[vmm_remapPage]([vmmFindFreePage]([_current]->[id]),0x5BC000,[KERNEL_PAGE_DEFAULT]|[PAGE_STACK]);
-[vmm_remapPage]([vmmFindFreePage]([_current]->[id]),0x5BB000,[KERNEL_PAGE_DEFAULT]|[PAGE_STACK]);
-
-
-[_current]->[tss].[back_link]=0x0;
-[_current]->[tss].[esp0]=0x5BC000;
-[_current]->[tss].[ss0]=0x10;
-[_current]->[tss].[esp1]=0x0;
-[_current]->[tss].[ss1]=0x0;
-[_current]->[tss].[esp2]=0x0;
-[_current]->[tss].[ss2]=0x0;
-[_current]->[tss].[eip]=(long)binaryHeader->[eEntry];
-[_current]->[tss].[eflags]=0x206;
-[_current]->[tss].[esp]=[STACK_ADDR]-12;
-[_current]->[tss].[ebp]=[STACK_ADDR];
-[_current]->[tss].[esi]=0x0;
-[_current]->[tss].[edi]=0x0;
-
-
-[_current]->[tss].[es]=0[x30]+3;
-[_current]->[tss].[cs]=0x28+3;
-[_current]->[tss].[ss]=0[x30]+3;
-[_current]->[tss].[ds]=0[x30]+3;
-[_current]->[tss].[fs]=0[x30]+3;
-[_current]->[tss].[gs]=0[x30]+3;
-
-[_current]->[tss].[ldt]=0[x18];
-[_current]->[tss].[trace_bitmap]=0x0000;
-[_current]->[tss].[io_map]=0x8000;
-
-[sched_setStatus]([_current]->[id],[READY]);
-
-[kfree](binaryHeader);
-[kfree](programHeader);
-[fclose](tmpFd);
-
-tmp=([uInt32]*)[_current]->[tss].[esp0]-5;
-tmp[0]=binaryHeader->[eEntry];
-tmp[3]=[STACK_ADDR]-12;
-
-tmp=([uInt32]*)[STACK_ADDR]-2;
-
-if([_current]->[id]>4)
-[kprintf]("argv[0]:[%s]\n",argv[0]);
-[kprintf]("argv:[0x%X]\n",argv);
-tmp[0]=([u_int32_t])argv;
-tmp[1]=([u_int32_t])argv;
-
+
+
+if((binaryHeader->[eIdent][1]!='E')&&(binaryHeader->[eIdent][2]!='L')&&(binaryHeader->[eIdent][3]!='F')){
+[kprintf]("ExecFormatError:BinaryFileNotExecutable.\n");
+[kfree](binaryHeader);
+[fclose](tmpFd);
+return;
+}
+elseif(binaryHeader->[eType]!=2){
+[kprintf]("ExecFormatError:BinaryFileNotExecutable.\n");
+[kfree](binaryHeader);
+[fclose](tmpFd);
+return;
+}
+elseif(binaryHeader->[eEntry]==0x300000){
+[kprintf]("ExecFormatError:BinaryFileNotExecutable.\n");
+[kfree](binaryHeader);
+[fclose](tmpFd);
+return;
+}
+
+
+programHeader=([elfProgramHeader]*)[kmalloc](sizeof([elfProgramHeader])*binaryHeader->[ePhnum]);
+[fseek](tmpFd,binaryHeader->[ePhoff],0);
+
+
+[fread](programHeader,(sizeof(elfProgramHeader)*binaryHeader->[ePhnum]),1,tmpFd);
+
+
+
+for(i=0;i<binaryHeader->[ePhnum];i++){
+if(programHeader[i].phType==1){
+
+
+
+
+for(x=0x0;x<(programHeader[i].[phMemsz]);x+=0x1000){
+
+if([vmm_remapPage]([vmmFindFreePage]([_current]->[id]),((programHeader[i].[phVaddr]&0xFFFFF000)+x),[PAGE_DEFAULT])==0x0)
+[K_PANIC]("RemapPageFailed");
+
+[memset]((void*)((programHeader[i].phVaddr&0xFFFFF000)+x),0x0,0[x1000]);
+}
+[_current]->[oInfo].[vmStart]=0x80000000;
+[_current]->[td].[vm_daddr]=(char*)(programHeader[i].phVaddr&0xFFFFF000);
+
+[fseek](tmpFd,programHeader[i].phOffset,0);
+[fread]((void*)programHeader[i].phVaddr,programHeader[i].phFilesz,1,tmpFd);
+if((programHeader[i].phFlags&0x2)!=0x2){
+[kprintf]("pH:[0x%X]\n",programHeader[i].phMemsz);
+for(x=0x0;x<(programHeader[i].[phMemsz]);x+=0x1000){
+if(([vmm_setPageAttributes]((programHeader[i].phVaddr&0xFFFFF000)+x,[PAGE_PRESENT]|[PAGE_USER]))!=0x0)
+[kpanic]("Error:vmm_setPageAttributesfailed,File:%s,Line:%i\n",__FILE__,__LINE__);
+}
+}
+}
+}
+
+
+[_current]->[oInfo].[vmStart]=0x80000000;
+[_current]->[td].[vm_daddr]=(char*)(programHeader[i].phVaddr&0xFFFFF000);
+
+
+for(x=1;x<100;x++){
+[vmm_remapPage]([vmmFindFreePage]([_current]->[id]),[STACK_ADDR]-(x*0[x1000]),[PAGE_DEFAULT]|[PAGE_STACK]);
+}
+
+
+[vmm_remapPage]([vmmFindFreePage]([_current]->[id]),0x5BC000,[KERNEL_PAGE_DEFAULT]|[PAGE_STACK]);
+[vmm_remapPage]([vmmFindFreePage]([_current]->[id]),0x5BB000,[KERNEL_PAGE_DEFAULT]|[PAGE_STACK]);
+
+
+[_current]->[tss].[back_link]=0x0;
+[_current]->[tss].[esp0]=0x5BC000;
+[_current]->[tss].[ss0]=0x10;
+[_current]->[tss].[esp1]=0x0;
+[_current]->[tss].[ss1]=0x0;
+[_current]->[tss].[esp2]=0x0;
+[_current]->[tss].[ss2]=0x0;
+[_current]->[tss].[eip]=(long)binaryHeader->[eEntry];
+[_current]->[tss].[eflags]=0x206;
+[_current]->[tss].[esp]=[STACK_ADDR]-12;
+[_current]->[tss].[ebp]=[STACK_ADDR];
+[_current]->[tss].[esi]=0x0;
+[_current]->[tss].[edi]=0x0;
+
+
+[_current]->[tss].[es]=0[x30]+3;
+[_current]->[tss].[cs]=0x28+3;
+[_current]->[tss].[ss]=0[x30]+3;
+[_current]->[tss].[ds]=0[x30]+3;
+[_current]->[tss].[fs]=0[x30]+3;
+[_current]->[tss].[gs]=0[x30]+3;
+
+[_current]->[tss].[ldt]=0[x18];
+[_current]->[tss].[trace_bitmap]=0x0000;
+[_current]->[tss].[io_map]=0x8000;
+
+[sched_setStatus]([_current]->[id],[READY]);
+
+[kfree](binaryHeader);
+[kfree](programHeader);
+[fclose](tmpFd);
+
+tmp=([uInt32]*)[_current]->[tss].[esp0]-5;
+tmp[0]=binaryHeader->[eEntry];
+tmp[3]=[STACK_ADDR]-12;
+
+tmp=([uInt32]*)[STACK_ADDR]-2;
+
+if([_current]->[id]>4)
+[kprintf]("argv[0]:[%s]\n",argv[0]);
+[kprintf]("argv:[0x%X]\n",argv);
+tmp[0]=([u_int32_t])argv;
+tmp[1]=([u_int32_t])argv;
-
-asmvolatile(
-"movl%0,%%eax\n"
-"movl%%eax,%%cr3\n"
-::"d"(([uInt32]*)([kernelPageDirectory]))
-);
-
-
-return;
-}
-
-
-
-
-
-
-
-
-
-
-void[sysExec](char*[file],char*ap){
-inti=0x0;
-intx=0x0;
-intargc=0x0;
-[uInt32]*tmp=0x0;
-[uInt32]ldAddr=0x0;
-[uInt32]seg_size=0x0;
-[uInt32]seg_addr=0x0;
-char*interp=0x0;
-char**argv=0x0;
-char**argvNew=0x0;
-char*args=0x0;
-
-[fileDescriptor]*tmpFd=0x0;
-[elfHeader]*binaryHeader=0x0;
-[elfProgramHeader]*programHeader=0x0;
-[elfSectionHeader]*sectionHeader=0x0;
-[elfDynamic]*elfDynamicS=0x0;
-struct[i386_frame]*iFrame=0x0;
-
-tmpFd=[fopen](file,"r");
-[_current]->[imageFd]=tmpFd;
-
-if(tmpFd==0x0){
+
+
+asmvolatile(
+"movl%0,%%eax\n"
+"movl%%eax,%%cr3\n"
+::"d"(([uInt32]*)([kernelPageDirectory]))
+);
+
+
+return;
+}
+
+
+
+
+
+
+
+
+
+
+void[sysExec](char*[file],char*ap){
+inti=0x0;
+intx=0x0;
+intargc=0x0;
+[uInt32]*tmp=0x0;
+[uInt32]ldAddr=0x0;
+[uInt32]seg_size=0x0;
+[uInt32]seg_addr=0x0;
+char*interp=0x0;
+char**argv=0x0;
+char**argvNew=0x0;
+char*args=0x0;
+
+[fileDescriptor]*tmpFd=0x0;
+[elfHeader]*binaryHeader=0x0;
+[elfProgramHeader]*programHeader=0x0;
+[elfSectionHeader]*sectionHeader=0x0;
+[elfDynamic]*elfDynamicS=0x0;
+struct[i386_frame]*iFrame=0x0;
+
+
+if([_current]->[id]>4){
+[sys_exec](file,ap);
return;
}
-if(tmpFd->[perms]==0){
-[kprintf]("ExecFormatError:BinaryFileNotExecutable.\n");
-[fclose](tmpFd);
-return;
-}
-
-
-
-if((binaryHeader=([elfHeader]*)[kmalloc](sizeof([elfHeader])))==0x0)
-[endTask]([_current]->[id]);
-[fread](binaryHeader,sizeof(elfHeader),1,tmpFd);
-
+
+tmpFd=[fopen](file,"r");
+[_current]->[imageFd]=tmpFd;
+
+if(tmpFd==0x0){
+return;
+}
+if(tmpFd->[perms]==0){
+[kprintf]("ExecFormatError:BinaryFileNotExecutable.\n");
+[fclose](tmpFd);
+return;
+}
-
-if((binaryHeader->[eIdent][1]!='E')&&(binaryHeader->[eIdent][2]!='L')&&(binaryHeader->[eIdent][3]!='F')){
-[kprintf]("ExecFormatError:BinaryFileNotExecutable.\n");
-[kfree](binaryHeader);
-[fclose](tmpFd);
-
-return;
-}
-elseif(binaryHeader->[eType]!=2){
+
+
+if((binaryHeader=([elfHeader]*)[kmalloc](sizeof([elfHeader])))==0x0)
+[endTask]([_current]->[id]);
+[fread](binaryHeader,sizeof(elfHeader),1,tmpFd);
+
+
+
+if((binaryHeader->[eIdent][1]!='E')&&(binaryHeader->[eIdent][2]!='L')&&(binaryHeader->[eIdent][3]!='F')){
[kprintf]("ExecFormatError:BinaryFileNotExecutable.\n");
[kfree](binaryHeader);
[fclose](tmpFd);
-return;
-}
-elseif(binaryHeader->[eEntry]==0x300000){
-[kprintf]("ExecFormatError:BinaryFileNotExecutable.\n");
-[kfree](binaryHeader);
-[fclose](tmpFd);
-return;
-}
-
-
-if((programHeader=([elfProgramHeader]*)[kmalloc](sizeof([elfProgramHeader])*binaryHeader->[ePhnum]))==0x0)
-[endTask]([_current]->[id]);
-
-[assert](programHeader);
-[fseek](tmpFd,binaryHeader->[ePhoff],0);
-[fread](programHeader,(sizeof(elfProgramHeader)*binaryHeader->[ePhnum]),1,tmpFd);
-
-if((sectionHeader=([elfSectionHeader]*)[kmalloc](sizeof([elfSectionHeader])*binaryHeader->[eShnum]))==0x0)
+
+return;
+}
+elseif(binaryHeader->[eType]!=2){
+[kprintf]("ExecFormatError:BinaryFileNotExecutable.\n");
+[kfree](binaryHeader);
+[fclose](tmpFd);
+return;
+}
+elseif(binaryHeader->[eEntry]==0x300000){
+[kprintf]("ExecFormatError:BinaryFileNotExecutable.\n");
+[kfree](binaryHeader);
+[fclose](tmpFd);
+return;
+}
+
+
+if((programHeader=([elfProgramHeader]*)[kmalloc](sizeof([elfProgramHeader])*binaryHeader->[ePhnum]))==0x0)
[endTask]([_current]->[id]);
-[assert](sectionHeader);
-[fseek](tmpFd,binaryHeader->[eShoff],0);
-[fread](sectionHeader,sizeof(elfSectionHeader)*binaryHeader->[eShnum],1,tmpFd);
+[assert](programHeader);
+[fseek](tmpFd,binaryHeader->[ePhoff],0);
+[fread](programHeader,(sizeof(elfProgramHeader)*binaryHeader->[ePhnum]),1,tmpFd);
-
-for(i=0;i<binaryHeader->[ePhnum];i++){
-switch(programHeader[i].phType){
-case[PT_LOAD]:
-seg_addr=[trunc_page](programHeader[i].phVaddr);
-seg_size=[round_page](programHeader[i].phMemsz+programHeader[i].phVaddr-seg_addr);
+if((sectionHeader=([elfSectionHeader]*)[kmalloc](sizeof([elfSectionHeader])*binaryHeader->[eShnum]))==0x0)
+[endTask]([_current]->[id]);
+
+[assert](sectionHeader);
+[fseek](tmpFd,binaryHeader->[eShoff],0);
+[fread](sectionHeader,sizeof(elfSectionHeader)*binaryHeader->[eShnum],1,tmpFd);
-
-
-
-
-for(x=0x0;x<(programHeader[i].[phMemsz]);x+=0x1000){
-
-if([vmm_remapPage]([vmmFindFreePage]([_current]->[id]),((programHeader[i].[phVaddr]&0xFFFFF000)+x),[PAGE_DEFAULT])==0x0)
-[K_PANIC]("Error:RemapPageFailed");
-[memset]((void*)((programHeader[i].phVaddr&0xFFFFF000)+x),0x0,0[x1000]);
-}
-
-
-[fseek](tmpFd,programHeader[i].phOffset,0);
-[fread]((void*)programHeader[i].phVaddr,programHeader[i].phFilesz,1,tmpFd);
-if((programHeader[i].phFlags&0x2)!=0x2){
-for(x=0x0;x<(programHeader[i].[phMemsz]);x+=0x1000){
-if(([vmm_setPageAttributes]((programHeader[i].phVaddr&0xFFFFF000)+x,[PAGE_PRESENT]|[PAGE_USER]))!=0x0)
-[kpanic]("Error:vmm_setPageAttributesfailed,File:%s,Line:%i\n",__FILE__,__LINE__);
-}
-}
-[kprintf]("settingdaddr\n");
-if(binaryHeader->[eEntry]>=programHeader[i].[phVaddr]&&binaryHeader->[eEntry]<(programHeader[i].[phVaddr]+programHeader[i].[phMemsz])){
-
-}
-else{
-[_current]->[td].[vm_dsize]=seg_size>>[PAGE_SHIFT];
-[_current]->[td].[vm_daddr]=(char*)seg_addr;
-}
-
-[_current]->[oInfo].[vmStart]=((programHeader[i].[phVaddr]&0xFFFFF000)+0xA900000);
-break;
-case[PT_DYNAMIC]:
-
-elfDynamicS=([elfDynamic]*)programHeader[i].phVaddr;
-[fseek](tmpFd,programHeader[i].phOffset,0);
-[fread]((void*)programHeader[i].phVaddr,programHeader[i].phFilesz,1,tmpFd);
-break;
-case[PT_INTERP]:
-interp=(char*)[kmalloc](programHeader[i].phFilesz);
-[fseek](tmpFd,programHeader[i].phOffset,0);
-[fread]((void*)interp,programHeader[i].phFilesz,1,tmpFd);
-[kprintf]("Interp:[%s]\n",interp);
-ldAddr=[ldEnable]();
+
+for(i=0;i<binaryHeader->[ePhnum];i++){
+switch(programHeader[i].phType){
+case[PT_LOAD]:
+seg_addr=[trunc_page](programHeader[i].phVaddr);
+seg_size=[round_page](programHeader[i].phMemsz+programHeader[i].phVaddr-seg_addr);
+
+
+
+
+
+for(x=0x0;x<(programHeader[i].[phMemsz]);x+=0x1000){
+
+if([vmm_remapPage]([vmmFindFreePage]([_current]->[id]),((programHeader[i].[phVaddr]&0xFFFFF000)+x),[PAGE_DEFAULT])==0x0)
+[K_PANIC]("Error:RemapPageFailed");
+[memset]((void*)((programHeader[i].phVaddr&0xFFFFF000)+x),0x0,0[x1000]);
+}
+
+
+[fseek](tmpFd,programHeader[i].phOffset,0);
+[fread]((void*)programHeader[i].phVaddr,programHeader[i].phFilesz,1,tmpFd);
+if((programHeader[i].phFlags&0x2)!=0x2){
+for(x=0x0;x<(programHeader[i].[phMemsz]);x+=0x1000){
+if(([vmm_setPageAttributes]((programHeader[i].phVaddr&0xFFFFF000)+x,[PAGE_PRESENT]|[PAGE_USER]))!=0x0)
+[kpanic]("Error:vmm_setPageAttributesfailed,File:%s,Line:%i\n",__FILE__,__LINE__);
+}
+}
+[kprintf]("settingdaddr\n");
+if(binaryHeader->[eEntry]>=programHeader[i].[phVaddr]&&binaryHeader->[eEntry]<(programHeader[i].[phVaddr]+programHeader[i].[phMemsz])){
+
+}
+else{
+[_current]->[td].[vm_dsize]=seg_size>>[PAGE_SHIFT];
+[_current]->[td].[vm_daddr]=(char*)seg_addr;
+}
+
+[_current]->[oInfo].[vmStart]=((programHeader[i].[phVaddr]&0xFFFFF000)+0xA900000);
+break;
+case[PT_DYNAMIC]:
+
+elfDynamicS=([elfDynamic]*)programHeader[i].phVaddr;
+[fseek](tmpFd,programHeader[i].phOffset,0);
+[fread]((void*)programHeader[i].phVaddr,programHeader[i].phFilesz,1,tmpFd);
break;
-default:
-break;
-}
-}
-
-
-if(elfDynamicS!=0x0){
-for(i=0;i<12;i++){
-if(elfDynamicS[i].dynVal==0x3){
-tmp=([uInt32]*)elfDynamicS[i].dynPtr;
-if(tmp==0x0)
-[kpanic]("tmp:NULL\n");
-tmp[2]=([uInt32])ldAddr;
-tmp[1]=([uInt32])tmpFd;
-break;
-}
-
-
-
-
-
-}
-}
-[_current]->[td].[vm_dsize]=seg_size>>[PAGE_SHIFT];
-[_current]->[td].[vm_daddr]=(char*)seg_addr;
-
-argv=ap;
-
-if(argv[1]!=0x0){
-argc=argv[0];
-args=(char*)[vmmGetFreeVirtualPage]([_current]->[id],1,[VM_TASK]);
-[memset](args,0x0,0[x1000]);
-x=0x0;
-argvNew=(char**)[kmalloc](sizeof(char*)*argc);
-for(i=0x0;i<argc;i++){
-[strcpy](args+x,argv[i+1]);
-argvNew[i]=args+x;
-x+=[strlen](argv[i+1])+1;
-
-
-}
-argv=argvNew;
-}
-
-[vmm_cleanVirtualSpace]([_current]->[td].[vm_daddr]+([_current]->[td].[vm_dsize]<<[PAGE_SIZE]));
-
-
-iFrame=[_current]->[tss].[esp0]-sizeof(struct[i386_frame]);
-iFrame->[ebp]=[STACK_ADDR];
-iFrame->[eip]=binaryHeader->[eEntry];
-iFrame->[user_esp]=[STACK_ADDR]-12;
-
-
+case[PT_INTERP]:
+interp=(char*)[kmalloc](programHeader[i].phFilesz);
+[fseek](tmpFd,programHeader[i].phOffset,0);
+[fread]((void*)interp,programHeader[i].phFilesz,1,tmpFd);
+[kprintf]("Interp:[%s]\n",interp);
+ldAddr=[ldEnable]();
+break;
+default:
+break;
+}
+}
+
+
+if(elfDynamicS!=0x0){
+for(i=0;i<12;i++){
+if(elfDynamicS[i].dynVal==0x3){
+tmp=([uInt32]*)elfDynamicS[i].dynPtr;
+if(tmp==0x0)
+[kpanic]("tmp:NULL\n");
+tmp[2]=([uInt32])ldAddr;
+tmp[1]=([uInt32])tmpFd;
+break;
+}
+
+
+
+
+
+}
+}
+
+[_current]->[td].[vm_dsize]=seg_size>>[PAGE_SHIFT];
+[_current]->[td].[vm_daddr]=(char*)seg_addr;
+
+argv=ap;
+
+if(argv[1]!=0x0){
+argc=argv[0];
+args=(char*)[vmmGetFreeVirtualPage]([_current]->[id],1,[VM_TASK]);
+[memset](args,0x0,0[x1000]);
+x=0x0;
+argvNew=(char**)[kmalloc](sizeof(char*)*argc);
+for(i=0x0;i<argc;i++){
+[strcpy](args+x,argv[i+1]);
+argvNew[i]=args+x;
+x+=[strlen](argv[i+1])+1;
+
+
+}
+argv=argvNew;
+}
+
+[vmm_cleanVirtualSpace]([_current]->[td].[vm_daddr]+([_current]->[td].[vm_dsize]<<[PAGE_SIZE]));
+
-iFrame->[user_esp]=(([u_int32_t])[STACK_ADDR])-(sizeof([u_int32_t])*(x+1));
-tmp=iFrame->[user_esp];
-
-tmp[0]=argc;
-for(i=0;i<argc;i++){
-tmp[i+1]=argv[i];
-}
-
-
-
-
-
-
-
-[kfree](argvNew);
-
-[kfree](binaryHeader);
-[kfree](programHeader);
-
-return;
-}
-
-
-
-
+iFrame=[_current]->[tss].[esp0]-sizeof(struct[i386_frame]);
+iFrame->[ebp]=[STACK_ADDR];
+iFrame->[eip]=binaryHeader->[eEntry];
+iFrame->[user_esp]=[STACK_ADDR]-12;
+
+
+
+iFrame->[user_esp]=(([u_int32_t])[STACK_ADDR])-(sizeof([u_int32_t])*(argc+3));
+tmp=iFrame->[user_esp];
+
+tmp[0]=argc;
+for(i=0;i<argc;i++){
+tmp[i+1]=argv[i];
+}
+tmp[argc+1]=0x0;
+tmp[argc+2]=0x1;
+
+
+
+
+
+
+
+[kfree](argvNew);
+
+[kfree](binaryHeader);
+[kfree](programHeader);
+
+return;
+}
+
+void[sys_exec](char*[file],char*ap){
+interror=0x0;
+inti=0x0;
+intx=0x0;
+intargc=0x0;
+[u_int32_t]seg_size=0x0;
+[u_int32_t]seg_addr=0x0;
+[u_int32_t]addr=0x0;
+[u_int32_t][eip]=0x0;
+[u_int32_t]proghdr=0x0;
+char*args=0x0;
+char*interp=0x0;
+char**argv=0x0;
+char**argvNew=0x0;
+[elfHeader]*binaryHeader=0x0;
+[elfProgramHeader]*programHeader=0x0;
+struct[i386_frame]*iFrame=0x0;
+[Elf_Auxargs]*auxargs=0x0;
+
+[_current]->[imageFd]=[fopen](file,"r");
+if([_current]->[imageFd]==0x0)
+return(-1);
+
+
+if((binaryHeader=([elfHeader]*)[kmalloc](sizeof([elfHeader])))==0x0)
+[K_PANIC]("mallocfailed!");
+[fread](binaryHeader,sizeof(elfHeader),1,[_current]->[imageFd]);
+
+
+if(((binaryHeader->[eIdent][1]!='E')&&(binaryHeader->[eIdent][2]!='L')&&(binaryHeader->[eIdent][3]!='F'))||(binaryHeader->[eType]!=[ET_EXEC])){
+[kfree](binaryHeader);
+[fclose]([_current]->[imageFd]);
+return(-1);
+}
+
+
+if((programHeader=([elfProgramHeader]*)[kmalloc](sizeof([elfProgramHeader])*binaryHeader->[ePhnum]))==0x0)
+[K_PANIC]("mallocfailed!");
+[fseek]([_current]->[imageFd],binaryHeader->[ePhoff],0);
+[fread](programHeader,(sizeof(elfProgramHeader)*binaryHeader->[ePhnum]),1,[_current]->[imageFd]);
+
+
+for(i=0x0;i<binaryHeader->[ePhnum];i++){
+switch(programHeader[i].phType){
+case[PT_LOAD]:
+seg_addr=[trunc_page](programHeader[i].phVaddr);
+seg_size=[round_page](programHeader[i].phMemsz+programHeader[i].phVaddr-seg_addr);
+
+
+
+
+
+for(x=0x0;x<(programHeader[i].[phMemsz]);x+=0x1000){
+
+if([vmm_remapPage]([vmmFindFreePage]([_current]->[id]),((programHeader[i].[phVaddr]&0xFFFFF000)+x),[PAGE_DEFAULT])==0x0)
+[K_PANIC]("Error:RemapPageFailed");
+[memset]((void*)((programHeader[i].phVaddr&0xFFFFF000)+x),0x0,0[x1000]);
+}
+
+
+[fseek]([_current]->[imageFd],programHeader[i].[phOffset],0);
+[fread]((void*)programHeader[i].phVaddr,programHeader[i].phFilesz,1,[_current]->[imageFd]);
+if((programHeader[i].phFlags&0x2)!=0x2){
+for(x=0x0;x<(programHeader[i].[phMemsz]);x+=0x1000){
+if(([vmm_setPageAttributes]((programHeader[i].phVaddr&0xFFFFF000)+x,[PAGE_PRESENT]|[PAGE_USER]))!=0x0)
+[K_PANIC]("vmm_setPageAttributesfailed");
+}
+}
+if(binaryHeader->[eEntry]>=programHeader[i].[phVaddr]&&binaryHeader->[eEntry]<(programHeader[i].[phVaddr]+programHeader[i].[phMemsz])){
+
+}
+else{
+[_current]->[td].[vm_dsize]=seg_size>>[PAGE_SHIFT];
+[_current]->[td].[vm_daddr]=(char*)seg_addr;
+}
+
+[_current]->[oInfo].[vmStart]=((programHeader[i].[phVaddr]&0xFFFFF000)+0xA900000);
+break;
+case[PT_INTERP]:
+interp=(char*)[kmalloc](programHeader[i].phFilesz);
+if(interp==0x0)
+[K_PANIC]("mallocfailed");
+
+[fseek]([_current]->[imageFd],programHeader[i].[phOffset],0);
+[fread]((void*)interp,programHeader[i].phFilesz,1,[_current]->[imageFd]);
+[kprintf]("Interp:[%s]\n",interp);
+
+break;
+case[PT_PHDR]:
+proghdr=programHeader[i].[phVaddr];
+break;
+default:
+break;
+}
+}
+
+addr=[LD_START];
+
+
+if(interp!=0x0){
+[kprintf]("TEST");
+[elf_loadfile]([_current],interp,&addr,&[eip]);
+}
+[kprintf]("[0x%X][0x%X]\n",[eip],addr);
+
+[_current]->[td].[vm_dsize]=seg_size>>[PAGE_SHIFT];
+[_current]->[td].[vm_daddr]=(char*)seg_addr;
+
+argv=ap;
+
+if(argv[1]!=0x0){
+argc=argv[0];
+args=(char*)[vmmGetFreeVirtualPage]([_current]->[id],1,[VM_TASK]);
+[memset](args,0x0,0[x1000]);
+x=0x0;
+argvNew=(char**)[kmalloc](sizeof(char*)*argc);
+for(i=0x0;i<argc;i++){
+[strcpy](args+x,argv[i+1]);
+argvNew[i]=args+x;
+x+=[strlen](argv[i+1])+1;
+}
+argv=argvNew;
+}
+
+[vmm_cleanVirtualSpace]([_current]->[td].[vm_daddr]+([_current]->[td].[vm_dsize]<<[PAGE_SIZE]));
+
+
+iFrame=[_current]->[tss].[esp0]-sizeof(struct[i386_frame]);
+iFrame->ebp=[STACK_ADDR];
+iFrame->eip=[eip];
+
+
+
+iFrame->user_esp=(([u_int32_t])[STACK_ADDR])-(sizeof([u_int32_t])*(argc+3+sizeof([Elf_Auxargs])));
+args=iFrame->user_esp;
+
+args[0]=argc;
+for(i=0;i<argc;i++){
+args[i+1]=argv[i];
+}
+args[argc+2]=0x0;
+auxargs=iFrame->user_esp+argc+2;
+auxargs->execfd=-1;
+auxargs->phdr=proghdr;
+auxargs->phent=binaryHeader->ePhentsize;
+auxargs->phnum=binaryHeader->ePhnum;
+auxargs->pagesz=[PAGE_SIZE];
+auxargs->base=addr;
+auxargs->flags=0x0;
+auxargs->entry=binaryHeader->eEntry;
+auxargs->trace=0x0;
+[kprintf]("\n\nDOH\n\n");
+
+
+
+
+
+
+
+return;
+}
+
+
+
+
diff --git a/doc/xml/exec_8h.xml b/doc/xml/exec_8h.xml
index b2509f9..cf49d07 100644
--- a/doc/xml/exec_8h.xml
+++ b/doc/xml/exec_8h.xml
@@ -11,125 +11,117 @@
src/sys/kernel/ubthread.c
src/sys/ubixfs/ubixfs.c
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
-
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
-
-
-
-
-
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
@@ -162,7 +154,7 @@
-
+
_current
assert
tssStruct::back_link
@@ -171,19 +163,19 @@
tssStruct::ds
tssStruct::ebp
tssStruct::edi
- elfHeader::eEntry
+ elfHeader::eEntry
tssStruct::eflags
- elfHeader::eIdent
+ elfHeader::eIdent
tssStruct::eip
- elfHeader::ePhnum
- elfHeader::ePhoff
+ elfHeader::ePhnum
+ elfHeader::ePhoff
tssStruct::es
tssStruct::esi
tssStruct::esp
tssStruct::esp0
tssStruct::esp1
tssStruct::esp2
- elfHeader::eType
+ elfHeader::eType
fclose
fopen
fread
@@ -198,7 +190,7 @@
kernelPageDirectory
kfree
kmalloc
- kpanic
+ kpanic
kprintf
tssStruct::ldt
memset
@@ -209,8 +201,8 @@
PAGE_STACK
PAGE_USER
fileDescriptorStruct::perms
- elfProgramHeader::phMemsz
- elfProgramHeader::phVaddr
+ elfProgramHeader::phMemsz
+ elfProgramHeader::phVaddr
READY
sched_setStatus
schedNewTask
@@ -218,7 +210,7 @@
tssStruct::ss0
tssStruct::ss1
tssStruct::ss2
- STACK_ADDR
+ STACK_ADDR
taskStruct::td
taskStruct::term
tssStruct::trace_bitmap
@@ -257,7 +249,7 @@
-
+
assert
tssStruct::back_link
tssStruct::cr3
@@ -279,7 +271,7 @@
taskStruct::imageFd
tssStruct::io_map
kernelPageDirectory
- kpanic
+ kpanic
tssStruct::ldt
taskStruct::oInfo
READY
@@ -295,6 +287,68 @@
kmain
ubthread_create
+
+ void
+ void sys_exec
+ (char *file, char *ap)
+ sys_exec
+
+ char *
+ file
+
+
+ char *
+ ap
+
+
+New exec...
+
+
+
+Clean the virtual of COW pages left over from the forkAdjust iframebuild argc and argv[]Start of Env
+
+ _current
+ elfHeader::eEntry
+ elfHeader::eIdent
+ i386_frame::eip
+ elfHeader::ePhnum
+ elfHeader::ePhoff
+ ET_EXEC
+ elfHeader::eType
+ fclose
+ fopen
+ fread
+ fseek
+ taskStruct::id
+ taskStruct::imageFd
+ K_PANIC
+ kfree
+ kmalloc
+ kprintf
+ memset
+ taskStruct::oInfo
+ PAGE_DEFAULT
+ PAGE_PRESENT
+ PAGE_SHIFT
+ PAGE_USER
+ elfProgramHeader::phMemsz
+ elfProgramHeader::phOffset
+ elfProgramHeader::phVaddr
+ PT_INTERP
+ PT_LOAD
+ PT_PHDR
+ round_page
+ taskStruct::td
+ trunc_page
+ thread::vm_daddr
+ thread::vm_dsize
+ vmm_remapPage
+ vmm_setPageAttributes
+ vmmFindFreePage
+ osInfo::vmStart
+ x1000
+ sysExec
+
@@ -338,29 +392,13 @@
[uInt32][execThread](void(*tproc)(void),[uInt32],char*);
void[execFile](char*[file],intargc,char**argv,intconsole);
-
-#endif
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+void[sys_exec](char*[file],char*ap);
+
+#endif
+
+
+
+
diff --git a/doc/xml/fdc_8c.xml b/doc/xml/fdc_8c.xml
index 09d7c4a..93466e8 100644
--- a/doc/xml/fdc_8c.xml
+++ b/doc/xml/fdc_8c.xml
@@ -16,138 +16,138 @@
lib/kmalloc.h
devfs/devfs.h
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
diff --git a/doc/xml/fdc_8h.xml b/doc/xml/fdc_8h.xml
index 9b0f175..718ea9f 100644
--- a/doc/xml/fdc_8h.xml
+++ b/doc/xml/fdc_8h.xml
@@ -6,43 +6,43 @@
src/sys/include/ubixos/init.h
src/sys/isa/fdc.c
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
diff --git a/doc/xml/ffs_8c.xml b/doc/xml/ffs_8c.xml
index 430f842..14ab8e0 100644
--- a/doc/xml/ffs_8c.xml
+++ b/doc/xml/ffs_8c.xml
@@ -11,148 +11,148 @@
lib/string.h
sys/buf.h
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
diff --git a/doc/xml/ffs_8h.xml b/doc/xml/ffs_8h.xml
index bb23f0a..8aa08e8 100644
--- a/doc/xml/ffs_8h.xml
+++ b/doc/xml/ffs_8h.xml
@@ -8,103 +8,103 @@
src/sys/ufs/ffs.c
src/sys/ufs/ufs.c
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
diff --git a/doc/xml/file_8c.xml b/doc/xml/file_8c.xml
index 4232f3c..17df88b 100644
--- a/doc/xml/file_8c.xml
+++ b/doc/xml/file_8c.xml
@@ -14,206 +14,194 @@
lib/kprintf.h
assert.h
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
-
-
+
-
+
-
+
-
+
-
+
-
-
-
-
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
-
-
-
-
-
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
@@ -247,10 +235,12 @@
spinUnlock
systemVitals
x1
- execFile
+ elf_loadfile
+ execFile
kmod_load
ldEnable
- sysExec
+ sys_exec
+ sysExec
sysFclose
sysMkDir
systemTask
@@ -346,11 +336,13 @@
systemVitals
vfs_findMount
fileSystem::vfsOpenFile
- execFile
+ elf_loadfile
+ execFile
kmod_load
ldEnable
+ sys_exec
sys_open
- sysExec
+ sysExec
sysFopen
sysMkDir
@@ -412,11 +404,13 @@
fileDescriptorStruct::mp
fileDescriptorStruct::offset
fileSystem::vfsRead
- execFile
+ elf_loadfile
+ execFile
kmod_load
ldEnable
read
- sysExec
+ sys_exec
+ sysExec
sysFread
@@ -444,10 +438,12 @@
fileDescriptorStruct::offset
- execFile
+ elf_loadfile
+ execFile
kmod_load
ldEnable
- sysExec
+ sys_exec
+ sysExec
[size_t]
diff --git a/doc/xml/fork_8c.xml b/doc/xml/fork_8c.xml
index 2601115..5aac65d 100644
--- a/doc/xml/fork_8c.xml
+++ b/doc/xml/fork_8c.xml
@@ -11,193 +11,181 @@
string.h
assert.h
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
-
-
+
-
+
-
+
-
-
-
-
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
-
-
-
-
-
-
+
-
+
-
+
-
+
-
+
diff --git a/doc/xml/fork_8h.xml b/doc/xml/fork_8h.xml
index d369705..1f50ee1 100644
--- a/doc/xml/fork_8h.xml
+++ b/doc/xml/fork_8h.xml
@@ -6,96 +6,88 @@
ubixos/sched.h
src/sys/kernel/fork.c
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
-
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
-
-
-
-
-
-
+
-
+
-
+
-
+
-
+
diff --git a/doc/xml/gdt_8h.xml b/doc/xml/gdt_8h.xml
index bed2022..f8fd26b 100644
--- a/doc/xml/gdt_8h.xml
+++ b/doc/xml/gdt_8h.xml
@@ -11,81 +11,81 @@
src/sys/pci/lnc.c
src/sys/sys/idt.c
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
diff --git a/doc/xml/gen__calls_8c.xml b/doc/xml/gen__calls_8c.xml
index f1008b7..72b75f0 100644
--- a/doc/xml/gen__calls_8c.xml
+++ b/doc/xml/gen__calls_8c.xml
@@ -12,152 +12,144 @@
string.h
assert.h
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
-
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
-
-
-
-
-
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
diff --git a/doc/xml/gen__calls_8h.xml b/doc/xml/gen__calls_8h.xml
index 3b941fb..f9e3f54 100644
--- a/doc/xml/gen__calls_8h.xml
+++ b/doc/xml/gen__calls_8h.xml
@@ -6,53 +6,53 @@
sys/sysproto.h
src/sys/kernel/gen_calls.c
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
diff --git a/doc/xml/getfreepage_8c.xml b/doc/xml/getfreepage_8c.xml
index a6763d8..dcbbbf2 100644
--- a/doc/xml/getfreepage_8c.xml
+++ b/doc/xml/getfreepage_8c.xml
@@ -6,72 +6,72 @@
ubixos/kpanic.h
ubixos/spinlock.h
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
@@ -93,7 +93,7 @@
KERNEL_PAGE_DEFAULT
- kpanic
+ kpanic
spinLock
spinUnlock
tablesBaseAddress
diff --git a/doc/xml/getfreevirtualpage_8c.xml b/doc/xml/getfreevirtualpage_8c.xml
index 2a53a77..f2a527a 100644
--- a/doc/xml/getfreevirtualpage_8c.xml
+++ b/doc/xml/getfreevirtualpage_8c.xml
@@ -8,138 +8,130 @@
ubixos/spinlock.h
lib/kprint.h
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
-
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
-
-
-
-
-
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
@@ -174,7 +166,7 @@
fvpSpinLock
taskStruct::id
K_PANIC
- kpanic
+ kpanic
kprintf
taskStruct::oInfo
PAGE_COW
@@ -197,7 +189,7 @@
x1
x1000
mmap
- sysExec
+ sysExec
sysGetFreePage
vmm_pageFault
diff --git a/doc/xml/getphysicaladdr_8c.xml b/doc/xml/getphysicaladdr_8c.xml
index 8ed75e3..c32c8c4 100644
--- a/doc/xml/getphysicaladdr_8c.xml
+++ b/doc/xml/getphysicaladdr_8c.xml
@@ -4,58 +4,58 @@
getphysicaladdr.c
vmm/vmm.h
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
diff --git a/doc/xml/hd_8c.xml b/doc/xml/hd_8c.xml
index 90edb58..c91b7d7 100644
--- a/doc/xml/hd_8c.xml
+++ b/doc/xml/hd_8c.xml
@@ -11,194 +11,186 @@
devfs/devfs.h
string.h
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
-
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
-
-
-
-
-
-
+
-
+
-
+
-
+
-
+
-
+
-
+
diff --git a/doc/xml/hd_8h.xml b/doc/xml/hd_8h.xml
index f328487..11bfce9 100644
--- a/doc/xml/hd_8h.xml
+++ b/doc/xml/hd_8h.xml
@@ -6,162 +6,154 @@
src/sys/include/ubixos/init.h
src/sys/pci/hd.c
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
-
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
-
-
-
-
-
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
diff --git a/doc/xml/idt_8c.xml b/doc/xml/idt_8c.xml
index 8c36714..ee58500 100644
--- a/doc/xml/idt_8c.xml
+++ b/doc/xml/idt_8c.xml
@@ -15,194 +15,186 @@
ubixos/endtask.h
string.h
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
-
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
-
-
-
-
-
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
@@ -238,7 +230,7 @@
_current
endTask
taskStruct::id
- kpanic
+ kpanic
sched_yield
idt_init
@@ -257,7 +249,7 @@
_current
endTask
taskStruct::id
- kpanic
+ kpanic
sched_yield
idt_init
@@ -276,7 +268,7 @@
_current
endTask
taskStruct::id
- kpanic
+ kpanic
sched_yield
idt_init
@@ -295,7 +287,7 @@
_current
endTask
taskStruct::id
- kpanic
+ kpanic
sched_yield
idt_init
@@ -314,7 +306,7 @@
_current
endTask
taskStruct::id
- kpanic
+ kpanic
sched_yield
idt_init
@@ -349,7 +341,7 @@
inportWord
irqDisable
irqEnable
- kpanic
+ kpanic
kprintf
taskStruct::oInfo
outportByte
@@ -378,7 +370,7 @@
_current
endTask
taskStruct::id
- kpanic
+ kpanic
sched_yield
idt_init
@@ -397,7 +389,7 @@
_current
endTask
taskStruct::id
- kpanic
+ kpanic
sched_yield
idt_init
@@ -416,7 +408,7 @@
_current
endTask
taskStruct::id
- kpanic
+ kpanic
sched_yield
idt_init
@@ -435,7 +427,7 @@
_current
endTask
taskStruct::id
- kpanic
+ kpanic
sched_yield
idt_init
@@ -454,7 +446,7 @@
_current
endTask
taskStruct::id
- kpanic
+ kpanic
sched_yield
idt_init
@@ -498,7 +490,7 @@
taskStruct::id
tssStruct::io_map
kernelPageDirectory
- kpanic
+ kpanic
tssStruct::ss
_int8
idt_init
@@ -518,7 +510,7 @@
_current
endTask
taskStruct::id
- kpanic
+ kpanic
sched_yield
idt_init
diff --git a/doc/xml/idt_8h.xml b/doc/xml/idt_8h.xml
index 2104650..162083d 100644
--- a/doc/xml/idt_8h.xml
+++ b/doc/xml/idt_8h.xml
@@ -13,85 +13,85 @@
src/sys/pci/lnc.c
src/sys/sys/idt.c
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
@@ -158,7 +158,7 @@
_current
endTask
taskStruct::id
- kpanic
+ kpanic
sched_yield
idt_init
@@ -177,7 +177,7 @@
_current
endTask
taskStruct::id
- kpanic
+ kpanic
sched_yield
idt_init
@@ -196,7 +196,7 @@
_current
endTask
taskStruct::id
- kpanic
+ kpanic
sched_yield
idt_init
@@ -215,7 +215,7 @@
_current
endTask
taskStruct::id
- kpanic
+ kpanic
sched_yield
idt_init
@@ -234,7 +234,7 @@
_current
endTask
taskStruct::id
- kpanic
+ kpanic
sched_yield
idt_init
@@ -269,7 +269,7 @@
inportWord
irqDisable
irqEnable
- kpanic
+ kpanic
kprintf
taskStruct::oInfo
outportByte
@@ -298,7 +298,7 @@
_current
endTask
taskStruct::id
- kpanic
+ kpanic
sched_yield
idt_init
@@ -317,7 +317,7 @@
_current
endTask
taskStruct::id
- kpanic
+ kpanic
sched_yield
idt_init
@@ -336,7 +336,7 @@
_current
endTask
taskStruct::id
- kpanic
+ kpanic
sched_yield
idt_init
@@ -355,7 +355,7 @@
_current
endTask
taskStruct::id
- kpanic
+ kpanic
sched_yield
idt_init
@@ -374,7 +374,7 @@
_current
endTask
taskStruct::id
- kpanic
+ kpanic
sched_yield
idt_init
@@ -419,7 +419,7 @@
taskStruct::id
tssStruct::io_map
kernelPageDirectory
- kpanic
+ kpanic
tssStruct::ss
_int8
idt_init
@@ -439,7 +439,7 @@
_current
endTask
taskStruct::id
- kpanic
+ kpanic
sched_yield
idt_init
diff --git a/doc/xml/index.xml b/doc/xml/index.xml
index 33d3dd8..4fa1895 100644
--- a/doc/xml/index.xml
+++ b/doc/xml/index.xml
@@ -275,6 +275,17 @@
txStartPage
word16
+ Elf_Auxargs
+ base
+ entry
+ execfd
+ flags
+ pagesz
+ phdr
+ phent
+ phnum
+ trace
+
elfDynamic
dynPtr
dynVal
@@ -1894,6 +1905,7 @@
R_386_PC32
R_386_PLT32
R_386_RELATIVE
+ elf_loadfile
elfGetPhType
elfGetRelType
elfGetShType
@@ -1904,6 +1916,7 @@
exec.h
execFile
execThread
+ sys_exec
fork.h
sysFork
@@ -2490,6 +2503,7 @@
biosCall
elf.c
+ elf_loadfile
elfGetPhType
elfGetRelType
elfGetShType
@@ -2513,6 +2527,7 @@
STACK_ADDR
execFile
execThread
+ sys_exec
sysExec
fork.c
diff --git a/doc/xml/io_8c.xml b/doc/xml/io_8c.xml
index 566689d..11ec3e6 100644
--- a/doc/xml/io_8c.xml
+++ b/doc/xml/io_8c.xml
@@ -4,13 +4,13 @@
io.c
sys/io.h
-
+
-
+
-
+
diff --git a/doc/xml/io_8h.xml b/doc/xml/io_8h.xml
index 30ed189..e581aa4 100644
--- a/doc/xml/io_8h.xml
+++ b/doc/xml/io_8h.xml
@@ -21,217 +21,217 @@
src/sys/sys/video.c
src/sys/vmm/vmm_memory.c
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
diff --git a/doc/xml/kern__descrip_8c.xml b/doc/xml/kern__descrip_8c.xml
index 35fc8e1..840ac72 100644
--- a/doc/xml/kern__descrip_8c.xml
+++ b/doc/xml/kern__descrip_8c.xml
@@ -11,144 +11,136 @@
lib/kmalloc.h
assert.h
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
-
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
-
-
-
-
-
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
diff --git a/doc/xml/kern__descrip_8h.xml b/doc/xml/kern__descrip_8h.xml
index c5313a4..b8312af 100644
--- a/doc/xml/kern__descrip_8h.xml
+++ b/doc/xml/kern__descrip_8h.xml
@@ -11,101 +11,101 @@
src/sys/kernel/sched.c
src/sys/vfs/vfs.c
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
diff --git a/doc/xml/kern__sig_8c.xml b/doc/xml/kern__sig_8c.xml
index 010d82c..eafac60 100644
--- a/doc/xml/kern__sig_8c.xml
+++ b/doc/xml/kern__sig_8c.xml
@@ -11,142 +11,134 @@
lib/kmalloc.h
assert.h
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
-
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
-
-
-
-
-
-
+
-
+
-
+
-
+
diff --git a/doc/xml/kern__sig_8h.xml b/doc/xml/kern__sig_8h.xml
index 41767ce..aa371b9 100644
--- a/doc/xml/kern__sig_8h.xml
+++ b/doc/xml/kern__sig_8h.xml
@@ -6,54 +6,54 @@
sys/sysproto.h
src/sys/kernel/kern_sig.c
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
diff --git a/doc/xml/kern__sysctl_8c.xml b/doc/xml/kern__sysctl_8c.xml
index 03c8fc6..29bde9f 100644
--- a/doc/xml/kern__sysctl_8c.xml
+++ b/doc/xml/kern__sysctl_8c.xml
@@ -13,156 +13,148 @@
assert.h
string.h
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
-
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
-
-
-
-
-
-
+
-
+
-
+
-
+
diff --git a/doc/xml/kern__sysctl_8h.xml b/doc/xml/kern__sysctl_8h.xml
index 2e3e774..99378fc 100644
--- a/doc/xml/kern__sysctl_8h.xml
+++ b/doc/xml/kern__sysctl_8h.xml
@@ -8,71 +8,71 @@
src/sys/kernel/kern_sysctl.c
src/sys/vmm/copyvirtualspace.c
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
diff --git a/doc/xml/kmalloc_8c.xml b/doc/xml/kmalloc_8c.xml
index e71ed2f..18fe1a7 100644
--- a/doc/xml/kmalloc_8c.xml
+++ b/doc/xml/kmalloc_8c.xml
@@ -11,160 +11,152 @@
string.h
assert.h
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
-
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
-
-
-
-
-
-
+
-
+
-
+
-
+
@@ -183,7 +175,7 @@
emptyDescSpinLock
emptyKernDesc
- kpanic
+ kpanic
memset
memDescriptor::next
memDescriptor::prev
@@ -211,7 +203,7 @@
assert
freeKernDesc
- kpanic
+ kpanic
memDescriptor::limit
memDescriptor::next
memDescriptor::prev
@@ -248,7 +240,8 @@
usedKernDesc
close
device_remove
- execFile
+ elf_loadfile
+ execFile
fclose
fopen
kmod_load
@@ -258,8 +251,9 @@
ne2kFreeBuffer
operator delete
operator delete[]
+ sys_exec
sys_write
- sysExec
+ sysExec
systemTask
ubixfs_cacheDelete
ubixFSmkDir
@@ -303,7 +297,8 @@
devfs_initialize
devfs_makeNode
device_add
- execFile
+ elf_loadfile
+ execFile
falloc
fdc_init
fopen
@@ -324,10 +319,11 @@
operator new[]
sched_init
schedNewTask
+ sys_exec
sys_write
sysctl_add
sysctl_init
- sysExec
+ sysExec
tty_init
ubixfs_cacheNew
ubixfs_initialize
diff --git a/doc/xml/kmalloc_8h.xml b/doc/xml/kmalloc_8h.xml
index 3f9c6b9..af5839f 100644
--- a/doc/xml/kmalloc_8h.xml
+++ b/doc/xml/kmalloc_8h.xml
@@ -9,6 +9,7 @@
src/sys/isa/fdc.c
src/sys/isa/ne2k.c
src/sys/kernel/bioscall.c
+ src/sys/kernel/elf.c
src/sys/kernel/exec.c
src/sys/kernel/gen_calls.c
src/sys/kernel/kern_descrip.c
@@ -40,241 +41,247 @@
src/sys/vmm/paging.c
src/sys/vmm/vmm_memory.c
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
+
+
+
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+