diff --git a/lib/TEST/NE PAS DETRUIRE b/final/cramfs/executables/cramfs.txt similarity index 100% rename from lib/TEST/NE PAS DETRUIRE rename to final/cramfs/executables/cramfs.txt diff --git a/final/harddisk.img.xz b/final/harddisk.img.xz index bfb608a..ded5682 100644 Binary files a/final/harddisk.img.xz and b/final/harddisk.img.xz differ diff --git a/final/makefile b/final/makefile index daabe11..37e13ee 100755 --- a/final/makefile +++ b/final/makefile @@ -1,40 +1,39 @@ -all: harddisk.img.final floppy.img.final harddiskuefi.img.final - harddiskuefi.img.before: - (xz -d -k harddiskuefi.img.xz) - (dd if=harddiskuefi.img of=harddiskuefi.img.part1 skip=13672 bs=512) - (dd if=harddiskuefi.img of=harddiskuefi.img.before count=13672 bs=512;sync) - (mkdir ./mnt -p) + xz -d -k harddiskuefi.img.xz + dd if=harddiskuefi.img of=harddiskuefi.img.part1 skip=13672 bs=512 + dd if=harddiskuefi.img of=harddiskuefi.img.before count=13672 bs=512 + mkdir ./mnt -p + sync -harddiskuefi.img.final: harddiskuefi.img.before - (mount.fuse-ext2 -o rw+ harddiskuefi.img.part1 ./mnt) - (cp ../system/system.sys ./mnt/boot/;sync) - (fusermount ./mnt -u) - (cat harddiskuefi.img.before > harddiskuefi.img.final) - (cat harddiskuefi.img.part1 >> harddiskuefi.img.final;sync) +harddiskuefi.img.final: initram.img harddiskuefi.img.before + mount.fuse-ext2 -o rw+ harddiskuefi.img.part1 ./mnt + cp ../system/system.sys ./mnt/boot/ + cp ./initram.img ./mnt/boot/ + sync + fusermount ./mnt -u + cat harddiskuefi.img.before > harddiskuefi.img.final + cat harddiskuefi.img.part1 >> harddiskuefi.img.final + sync harddisk.img.before: - (xz -d -k harddisk.img.xz) - (dd if=harddisk.img of=harddisk.img.part1 skip=63 bs=512) - (dd if=harddisk.img of=harddisk.img.before count=63 bs=512;sync) - (mkdir ./mnt -p) + xz -d -k harddisk.img.xz + dd if=harddisk.img of=harddisk.img.part1 skip=63 bs=512 + dd if=harddisk.img of=harddisk.img.before count=63 bs=512 + mkdir ./mnt -p + sync -harddisk.img.final: harddisk.img.before - (mount.fuse-ext2 -o rw+ harddisk.img.part1 ./mnt) - (cp ../system/system.sys ./mnt/boot/;sync) - (fusermount ./mnt -u) - (cat harddisk.img.before > harddisk.img.final) - (cat harddisk.img.part1 >> harddisk.img.final;sync) +harddisk.img.final: initram.img harddisk.img.before + mount.fuse-ext2 -o rw+ harddisk.img.part1 ./mnt + cp ../system/system.sys ./mnt/boot/ + cp ./initram.img ./mnt/boot/ + sync + fusermount ./mnt -u + cat harddisk.img.before > harddisk.img.final + cat harddisk.img.part1 >> harddisk.img.final + sync -floppy.img.final: - (dd if=/dev/zero of=floppy.img.final count=2880 bs=512) - (mkfs.msdos -F 12 -n "COS2000" floppy.img.final) - (mkdir ./mnt -p) - (fusefat floppy.img.final ./mnt -o rw+) - (cp ../boot/loader.sys ./mnt/) - (cp ../system/system.sys ./mnt/;sync) - (fusermount ./mnt -u) - (dd if=../boot/boot12.bin of=floppy.img.final seek=0 count=1 conv=notrunc;sync) +initram.img: + make -C ../programs littleclean: rm -f *.final diff --git a/final/makeimage b/final/makeimage index f77c077..6fc186f 100755 --- a/final/makeimage +++ b/final/makeimage @@ -8,7 +8,7 @@ echo ${lo} losetup -P ${lo} harddisk.img mkfs.ext2 ${lo}p1 mount ${lo}p1 /mnt -grub-install --no-floppy --install-modules="biosdisk part_msdos ext2 configfile normal linux16 vbe png gfxmenu video video_colors video_cirrus video_fb" --boot-directory=/mnt/boot ${lo} --target=i386-pc +grub-install --no-floppy --install-modules="biosdisk part_msdos ext2 configfile normal linux16 linux vbe png gfxmenu video video_colors video_cirrus video_fb" --boot-directory=/mnt/boot ${lo} --target=i386-pc echo -en "\ insmod ext2 insmod biosdisk @@ -22,7 +22,8 @@ set timeout=4\n\ set default=0\n\ menuentry "cos2000" {\n\ set root=(hd0,1)\n\ -linux16 /boot/system.sys root=hd0,2\n +linux16 /boot/system.sys root=hd0,2 vesa=0318\n\ +initrd16 /boot/initram.img\n\ boot\n\ }" > /mnt/boot/grub/grub.cfg umount /mnt diff --git a/include/boot.h b/include/boot.h index 63b55c3..bf2591a 100644 --- a/include/boot.h +++ b/include/boot.h @@ -25,6 +25,8 @@ typedef struct bootparams { u32 e820_numbers; u8* cmdline; u8 kbflag; + u32 ramdisksize; + u32 ramdiskaddr; } bootparams; diff --git a/lib/shell.c b/lib/shell.c index 77474a1..bf98a6a 100644 --- a/lib/shell.c +++ b/lib/shell.c @@ -129,15 +129,13 @@ int ps() /*******************************************************************************/ /* Test l'usage de création de tâche */ -#include "TEST/test.c" -#include "TEST/test2.c" int testtask() { print("*** Creation d'une tache\r\n"); pid_t pid; - pid = createprocess(&programs_test2, false); + pid = createprocess(NULL, false); runprocess(pid); - pid = createprocess(&programs_test, false); + pid = createprocess(NULL, false); runprocess(pid); } diff --git a/makefile b/makefile index 6a02df0..8c3e354 100755 --- a/makefile +++ b/makefile @@ -27,15 +27,7 @@ syscall: clean remakeapi all remakeapi: $(MAKECALL) -programs: programs/test lib/TEST/test.c lib/TEST/test2.c - -lib/TEST/test.c: - xxd -i programs/test lib/TEST/test.c - -lib/TEST/test2.c: - xxd -i programs/test2 lib/TEST/test2.c - -programs/test: +programs: make -C programs harddisk: final/harddisk.img.final @@ -43,7 +35,7 @@ harddisk: final/harddisk.img.final uefi: final/harddiskuefi.img.final install: - $(INSTALL) gcc qemu fusefat fuseext2 gdb ovmf bsdmainutils tar bsdmainutils indent binutils bochs bochs-x bochsbios dos2unix gnome-terminal + $(INSTALL) gcc qemu fusefat fuseext2 gdb ovmf bsdmainutils tar bsdmainutils cramfsprogs indent binutils bochs bochs-x bochsbios dos2unix gnome-terminal togit: make -C system togit diff --git a/programs/makefile b/programs/makefile index a17bb24..91bd64a 100755 --- a/programs/makefile +++ b/programs/makefile @@ -7,12 +7,17 @@ INDENT=indent -nhnl -l75 -ppi3 -ts8 -bls -nbc -di8 -nbad -nbap -nsob -i8 -bl -bl REMOVE=rm -f CHANGELF=elfedit --output-osabi FenixOS CHANGEPERM=chmod 644 +MOVE=mv -all: lib/libs.a $(EXECS) +all: lib/libs.a ../final/initram.img sync togit: clean indent +../final/initram.img: $(EXECS) + (find . -type f ! -perm /u=x -maxdepth 1 -regex '.+/\.?[^\.]+' -exec $(MOVE) {} ../final/cramfs/executables/ \;;true) + mkcramfs ../final/cramfs/ ../final/initram.img + lib/libs.a: make -C lib @@ -26,7 +31,8 @@ clean: make -C lib clean $(REMOVE) *.o $(REMOVE) *.c~ - find . -type f ! -perm /u=x -maxdepth 1 -regex '.+/\.?[^\.]+' -exec $(REMOVE) {} \; + (find ../final/cramfs/executables -type f ! -perm /u=x -maxdepth 1 -regex '.+/\.?[^\.]+' -exec $(REMOVE) {} \;;true) + (find . -type f ! -perm /u=x -maxdepth 1 -regex '.+/\.?[^\.]+' -exec $(REMOVE) {} \;;true) sync indent: diff --git a/system/realmode/setup.c b/system/realmode/setup.c index 9af8745..6190aeb 100644 --- a/system/realmode/setup.c +++ b/system/realmode/setup.c @@ -274,7 +274,9 @@ void initpmode() void initparams() { - //params.cmdline=((header*)hdr)->cmd_line_ptr; + params.cmdline=((header*)&hdr)->cmd_line_ptr; + params.ramdiskaddr=((header*)&hdr)->ramdisk_image; + params.ramdisksize=((header*)&hdr)->ramdisk_size; asm("xorl %%eax,%%eax\n \ movw %%ds,%%ax\n \ shl $4,%%eax\n \