mirror of
https://github.com/EnderIce2/Fennix.git
synced 2025-05-27 15:04:31 +00:00
refactor(rootfs): change "initrd" to "rootfs"
Signed-off-by: EnderIce2 <enderice2@protonmail.com>
This commit is contained in:
parent
1286c4cd90
commit
527e1708ce
6
.gitignore
vendored
6
.gitignore
vendored
@ -1,10 +1,10 @@
|
|||||||
iso_tmp_data
|
iso_tmp_data
|
||||||
artifacts
|
artifacts
|
||||||
initrd_tmp_data
|
initrd_tmp_data
|
||||||
initrd/usr/include/*
|
rootfs/usr/include/*
|
||||||
!initrd/usr/include/.gitkeep
|
!rootfs/usr/include/.gitkeep
|
||||||
doxygen-doc
|
doxygen-doc
|
||||||
initrd.tar
|
rootfs.tar
|
||||||
.dccache
|
.dccache
|
||||||
*.log
|
*.log
|
||||||
*.log.*
|
*.log.*
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
"git.openRepositoryInParentFolders": "always",
|
"git.openRepositoryInParentFolders": "always",
|
||||||
"C_Cpp.autoAddFileAssociations": false,
|
"C_Cpp.autoAddFileAssociations": false,
|
||||||
"conventionalCommits.scopes": [
|
"conventionalCommits.scopes": [
|
||||||
"initrd",
|
"rootfs",
|
||||||
"tools",
|
"tools",
|
||||||
"devcontainer"
|
"devcontainer"
|
||||||
]
|
]
|
||||||
|
@ -31,10 +31,10 @@ void SearchForInitrd()
|
|||||||
if (!initrdAddress)
|
if (!initrdAddress)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (strcmp(bInfo.Modules[i].CommandLine, "initrd") != 0)
|
if (strcmp(bInfo.Modules[i].CommandLine, "rootfs") != 0)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
KPrint("initrd found at %#lx", initrdAddress);
|
KPrint("rootfs found at %#lx", initrdAddress);
|
||||||
|
|
||||||
Memory::Virtual vmm;
|
Memory::Virtual vmm;
|
||||||
if (!vmm.Check((void *)initrdAddress))
|
if (!vmm.Check((void *)initrdAddress))
|
||||||
|
@ -843,9 +843,9 @@ bool TestAndInitializeUSTAR(uintptr_t Address, size_t Size)
|
|||||||
ustar->DeviceID = fs->EarlyReserveDevice();
|
ustar->DeviceID = fs->EarlyReserveDevice();
|
||||||
ustar->ReadArchive(Address, Size);
|
ustar->ReadArchive(Address, Size);
|
||||||
|
|
||||||
Inode *initrd = nullptr;
|
Inode *rootfs = nullptr;
|
||||||
ustar->Lookup(nullptr, "/", &initrd);
|
ustar->Lookup(nullptr, "/", &rootfs);
|
||||||
assert(initrd != nullptr);
|
assert(rootfs != nullptr);
|
||||||
|
|
||||||
FileSystemInfo *fsi = new FileSystemInfo;
|
FileSystemInfo *fsi = new FileSystemInfo;
|
||||||
fsi->Name = "ustar";
|
fsi->Name = "ustar";
|
||||||
@ -861,8 +861,8 @@ bool TestAndInitializeUSTAR(uintptr_t Address, size_t Size)
|
|||||||
fsi->Ops.ReadLink = __ustar_ReadLink;
|
fsi->Ops.ReadLink = __ustar_ReadLink;
|
||||||
fsi->Ops.Stat = __ustar_Stat;
|
fsi->Ops.Stat = __ustar_Stat;
|
||||||
fsi->PrivateData = ustar;
|
fsi->PrivateData = ustar;
|
||||||
fs->LateRegisterFileSystem(ustar->DeviceID, fsi, initrd);
|
fs->LateRegisterFileSystem(ustar->DeviceID, fsi, rootfs);
|
||||||
|
|
||||||
fs->AddRoot(initrd);
|
fs->AddRoot(rootfs);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
10
Makefile
10
Makefile
@ -212,16 +212,16 @@ endif
|
|||||||
build_image:
|
build_image:
|
||||||
mkdir -p iso_tmp_data
|
mkdir -p iso_tmp_data
|
||||||
mkdir -p initrd_tmp_data
|
mkdir -p initrd_tmp_data
|
||||||
cp -r initrd/* initrd_tmp_data/
|
cp -r rootfs/* initrd_tmp_data/
|
||||||
ifeq ($(BUILD_DRIVERS), 1)
|
ifeq ($(BUILD_DRIVERS), 1)
|
||||||
cp -r Drivers/out/* initrd_tmp_data/usr/lib/drivers/
|
cp -r Drivers/out/* initrd_tmp_data/usr/lib/drivers/
|
||||||
endif
|
endif
|
||||||
ifeq ($(BUILD_USERSPACE), 1)
|
ifeq ($(BUILD_USERSPACE), 1)
|
||||||
cp -r Userspace/out/* initrd_tmp_data/
|
cp -r Userspace/out/* initrd_tmp_data/
|
||||||
endif
|
endif
|
||||||
# tar czf initrd.tar -C initrd_tmp_data/ ./ --format=ustar
|
# tar czf rootfs.tar -C initrd_tmp_data/ ./ --format=ustar
|
||||||
tar cf initrd.tar -C initrd_tmp_data/ ./ --format=ustar
|
tar cf rootfs.tar -C initrd_tmp_data/ ./ --format=ustar
|
||||||
cp Kernel/fennix.elf initrd.tar \
|
cp Kernel/fennix.elf rootfs.tar \
|
||||||
iso_tmp_data/
|
iso_tmp_data/
|
||||||
ifeq ($(BOOTLOADER), limine)
|
ifeq ($(BOOTLOADER), limine)
|
||||||
cp tools/limine.cfg tools/limine/limine-bios.sys \
|
cp tools/limine.cfg tools/limine/limine-bios.sys \
|
||||||
@ -330,7 +330,7 @@ run: build qemu
|
|||||||
|
|
||||||
clean: clean_logs
|
clean: clean_logs
|
||||||
rm -rf doxygen-doc iso_tmp_data initrd_tmp_data
|
rm -rf doxygen-doc iso_tmp_data initrd_tmp_data
|
||||||
rm -f initrd.tar $(OSNAME).iso $(OSNAME).img
|
rm -f rootfs.tar $(OSNAME).iso $(OSNAME).img
|
||||||
$(MAKE) -C Kernel clean
|
$(MAKE) -C Kernel clean
|
||||||
$(MAKE) -C Userspace clean
|
$(MAKE) -C Userspace clean
|
||||||
$(MAKE) -C Drivers clean
|
$(MAKE) -C Drivers clean
|
||||||
|
@ -7,9 +7,9 @@ menuentry "Fennix" {
|
|||||||
load_video
|
load_video
|
||||||
clear
|
clear
|
||||||
echo "Loading kernel"
|
echo "Loading kernel"
|
||||||
multiboot2 /fennix.elf --ioapicirq=1 --udl=true --simd=true --init=/bin/init
|
multiboot2 /fennix.elf --ioapicirq=1 --udl=true --simd=true --init=/bin/fsh
|
||||||
echo "Loading initrd"
|
echo "Loading rootfs"
|
||||||
module2 /initrd.tar initrd
|
module2 /rootfs.tar rootfs
|
||||||
echo "Booting..."
|
echo "Booting..."
|
||||||
boot
|
boot
|
||||||
}
|
}
|
||||||
|
@ -8,5 +8,5 @@ INTERFACE_BRANDING=Fennix
|
|||||||
KERNEL_CMDLINE=--ioapicirq=1 --udl=true --simd=true
|
KERNEL_CMDLINE=--ioapicirq=1 --udl=true --simd=true
|
||||||
KERNEL_PATH=boot:///fennix.elf
|
KERNEL_PATH=boot:///fennix.elf
|
||||||
|
|
||||||
MODULE_PATH=boot:///initrd.tar
|
MODULE_PATH=boot:///rootfs.tar
|
||||||
MODULE_CMDLINE=initrd
|
MODULE_CMDLINE=rootfs
|
||||||
|
@ -1,2 +1,2 @@
|
|||||||
CMDLINE=debug
|
CMDLINE=debug
|
||||||
INITRD=initrd.tar
|
INITRD=rootfs.tar
|
||||||
|
Loading…
x
Reference in New Issue
Block a user