mirror of
https://github.com/Zeal-Operating-System/ZealOS.git
synced 2024-12-25 23:10:32 +00:00
Change build system to copy all files to Tmp/OSBuild, then perform build inside OS using reboots without using host script to repeatedly power off and on again.
This commit is contained in:
parent
a327043057
commit
0cfaff51b9
6 changed files with 88 additions and 28 deletions
BIN
build/AUTO.ISO
BIN
build/AUTO.ISO
Binary file not shown.
|
@ -46,39 +46,19 @@ echo "Building ZealBooter..."
|
|||
set +e
|
||||
|
||||
echo "Making temp vdisk, running auto-install ..."
|
||||
qemu-img create -f raw $TMPDISK 192M
|
||||
qemu-img create -f raw $TMPDISK 1024M
|
||||
qemu-system-x86_64 -machine q35,accel=kvm -drive format=raw,file=$TMPDISK -m 1G -rtc base=localtime -smp 4 -cdrom AUTO.ISO -device isa-debug-exit
|
||||
|
||||
echo "Copying src/Kernel/KStart16.ZC and src/Kernel/KernelA.HH into vdisk ..."
|
||||
rm ../src/Home/Registry.ZC 2> /dev/null
|
||||
rm ../src/Home/MakeHome.ZC 2> /dev/null
|
||||
mount_tempdisk
|
||||
sudo cp -rf ../src/Kernel/KStart16.ZC $TMPMOUNT/Kernel/
|
||||
sudo cp -rf ../src/Kernel/KernelA.HH $TMPMOUNT/Kernel/
|
||||
umount_tempdisk
|
||||
|
||||
echo "Rebuilding kernel headers ..."
|
||||
qemu-system-x86_64 -machine q35,accel=kvm -drive format=raw,file=$TMPDISK -m 1G -rtc base=localtime -smp 4 -device isa-debug-exit
|
||||
|
||||
echo "Copying all kernel code into vdisk ..."
|
||||
rm ../src/Home/Registry.ZC 2> /dev/null
|
||||
rm ../src/Home/MakeHome.ZC 2> /dev/null
|
||||
mount_tempdisk
|
||||
sudo cp -rf ../src/Kernel/* $TMPMOUNT/Kernel/
|
||||
umount_tempdisk
|
||||
|
||||
echo "Rebuilding kernel..."
|
||||
qemu-system-x86_64 -machine q35,accel=kvm -drive format=raw,file=$TMPDISK -m 1G -rtc base=localtime -smp 4 -device isa-debug-exit
|
||||
|
||||
echo "Copying all src/ code into vdisk ..."
|
||||
echo "Copying all src/ code into vdisk Tmp/OSBuild/ ..."
|
||||
rm ../src/Home/Registry.ZC 2> /dev/null
|
||||
rm ../src/Home/MakeHome.ZC 2> /dev/null
|
||||
rm ../src/Boot/Kernel.ZXE 2> /dev/null
|
||||
mount_tempdisk
|
||||
sudo cp -r ../src/* $TMPMOUNT
|
||||
sudo mkdir $TMPMOUNT/Tmp/OSBuild/
|
||||
sudo cp -r ../src/* $TMPMOUNT/Tmp/OSBuild
|
||||
umount_tempdisk
|
||||
|
||||
echo "Building Distro ISO ..."
|
||||
echo "Rebuilding kernel headers, kernel, OS, and building Distro ISO ..."
|
||||
qemu-system-x86_64 -machine q35,accel=kvm -drive format=raw,file=$TMPDISK -m 1G -rtc base=localtime -smp 4 -device isa-debug-exit
|
||||
|
||||
LIMINE_BINARY_BRANCH="v4.x-branch-binary"
|
||||
|
|
|
@ -18,11 +18,15 @@ U0 Auto()
|
|||
}
|
||||
}
|
||||
|
||||
WinMax;
|
||||
BootMHDIns('C');
|
||||
in_str = MStrPrint("Sleep(700);In(\"CC\\n%d\\n\\n\\n\\n\");", ata_port);
|
||||
OnceDrive('C', in_str);
|
||||
Free(in_str);
|
||||
in_str = MStrPrint("BootHDIns;OnceFlush;Once(\"#include \\\"/Misc/Auto/AutoFullDistro00\\\";;Auto;\");OutU8(0x501,0x31);");
|
||||
in_str = MStrPrint( "BootHDIns;"
|
||||
"OnceFlush;"
|
||||
"Once(\"#include \\\"/Misc/Auto/AutoFullDistro00\\\";;Auto;\");"
|
||||
"Reboot;");
|
||||
OnceDrive('C', in_str);
|
||||
OutU8(0x501,0x31);
|
||||
}
|
||||
|
|
|
@ -18,13 +18,20 @@ U0 Auto()
|
|||
}
|
||||
}
|
||||
|
||||
WinMax;
|
||||
BootMHDIns('C');
|
||||
Copy("C:/Tmp/OSBuild/Kernel/KStart16.ZC", "C:/Kernel/");
|
||||
Copy("C:/Tmp/OSBuild/Kernel/KernelA.HH", "C:/Kernel/");
|
||||
in_str = MStrPrint("CC\n%d\n\n\n\n", ata_port);
|
||||
Sleep(700);
|
||||
In(in_str);
|
||||
BootHDIns;
|
||||
OnceFlush;
|
||||
in_str = MStrPrint("#include \"/Misc/Auto/AutoFullDistro1\";;Auto;;");
|
||||
Free(in_str);
|
||||
in_str = MStrPrint( "OnceFlush;"
|
||||
"Once(\"#include \\\"/Misc/Auto/AutoFullDistro000\\\";;Auto;\");"
|
||||
"Reboot;");
|
||||
OnceDrive('C', in_str);
|
||||
OutU8(0x501,0x31);
|
||||
Reboot;
|
||||
}
|
||||
Auto;
|
||||
|
|
36
src/Misc/Auto/AutoFullDistro000.ZC
Executable file
36
src/Misc/Auto/AutoFullDistro000.ZC
Executable file
|
@ -0,0 +1,36 @@
|
|||
U0 Auto()
|
||||
{
|
||||
I64 i, ata_port = -1;
|
||||
CAHCIPort *port;
|
||||
U8 *in_str;
|
||||
|
||||
for (i = 0; i < AHCI_MAX_PORTS; i++)
|
||||
|
||||
{
|
||||
if (PCIBt(&blkdev.ahci_hba->ports_implemented, i))
|
||||
{
|
||||
port = &blkdev.ahci_hba->ports[i];
|
||||
if (port->signature == AHCI_PxSIG_ATA)
|
||||
{
|
||||
ata_port = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
WinMax;
|
||||
BootMHDIns('C');
|
||||
CopyTree("C:/Tmp/OSBuild/Kernel/", "C:/Kernel/");
|
||||
in_str = MStrPrint("CC\n%d\n\n\n\n", ata_port);
|
||||
Sleep(700);
|
||||
In(in_str);
|
||||
BootHDIns;
|
||||
OnceFlush;
|
||||
Free(in_str);
|
||||
in_str = MStrPrint( "OnceFlush;"
|
||||
"Once(\"#include \\\"/Misc/Auto/AutoFullDistro0000\\\";;Auto;\");"
|
||||
"Reboot;");
|
||||
OnceDrive('C', in_str);
|
||||
Reboot;
|
||||
}
|
||||
Auto;
|
33
src/Misc/Auto/AutoFullDistro0000.ZC
Executable file
33
src/Misc/Auto/AutoFullDistro0000.ZC
Executable file
|
@ -0,0 +1,33 @@
|
|||
U0 Auto()
|
||||
{
|
||||
I64 i, ata_port = -1;
|
||||
CAHCIPort *port;
|
||||
U8 *in_str;
|
||||
|
||||
for (i = 0; i < AHCI_MAX_PORTS; i++)
|
||||
|
||||
{
|
||||
if (PCIBt(&blkdev.ahci_hba->ports_implemented, i))
|
||||
{
|
||||
port = &blkdev.ahci_hba->ports[i];
|
||||
if (port->signature == AHCI_PxSIG_ATA)
|
||||
{
|
||||
ata_port = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
WinMax;
|
||||
CopyTree("C:/Tmp/OSBuild/", "C:/");
|
||||
in_str = MStrPrint("CC\n%d\n\n\n\n", ata_port);
|
||||
Sleep(700);
|
||||
In(in_str);
|
||||
BootHDIns;
|
||||
OnceFlush;
|
||||
in_str = MStrPrint("#include \"/Misc/Auto/AutoFullDistro1\";;Auto;;");
|
||||
OnceDrive('C', in_str);
|
||||
DelTree("C:/Tmp/OSBuild");
|
||||
Reboot;
|
||||
}
|
||||
Auto;
|
Loading…
Reference in a new issue