feat: mise en place du chargement d'une arborescence CRAMFS pour demarrer le système
This commit is contained in:
parent
4f7aae792e
commit
acb06bc8a8
Binary file not shown.
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -25,6 +25,8 @@ typedef struct bootparams {
|
|||
u32 e820_numbers;
|
||||
u8* cmdline;
|
||||
u8 kbflag;
|
||||
u32 ramdisksize;
|
||||
u32 ramdiskaddr;
|
||||
} bootparams;
|
||||
|
||||
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
12
makefile
12
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
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -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 \
|
||||
|
|
Loading…
Reference in New Issue