diff options
Diffstat (limited to 'dev/kernel')
| -rw-r--r-- | dev/kernel/FSKit/HeFS.h | 14 | ||||
| -rw-r--r-- | dev/kernel/HALKit/AMD64/HalDebugOutput.cc | 14 | ||||
| -rw-r--r-- | dev/kernel/src/FS/HeFS+FileSystemParser.cc | 29 | ||||
| -rw-r--r-- | dev/kernel/src/UtfUtils.cc | 2 |
4 files changed, 28 insertions, 31 deletions
diff --git a/dev/kernel/FSKit/HeFS.h b/dev/kernel/FSKit/HeFS.h index 85421069..bf1bf867 100644 --- a/dev/kernel/FSKit/HeFS.h +++ b/dev/kernel/FSKit/HeFS.h @@ -25,7 +25,7 @@ #define kHeFSFileNameLen (256U)
#define kHeFSPartNameLen (128U)
-#define kHeFSMinimumDiskSize (gib_cast(1))
+#define kHeFSMinimumDiskSize (gib_cast(8))
#define kHeFSDefaultVolumeName u8"HeFS Volume"
@@ -38,7 +38,6 @@ struct HEFS_BOOT_NODE; struct HEFS_INDEX_NODE;
struct HEFS_INDEX_NODE_DIRECTORY;
struct HEFS_JOURNAL_NODE;
-struct HEFS_SLICE_NODE;
enum : UInt8 {
kHeFSHardDrive = 0xC0, // Hard Drive
@@ -135,12 +134,6 @@ struct PACKED HEFS_BOOT_NODE final { inline constexpr ATime kHeFSTimeInvalid = 0x0000000000000000;
inline constexpr ATime kHeFSTimeMax = 0xFFFFFFFFFFFFFFFF - 1;
-/// @brief INode Slice structure, organized like a range container.
-struct PACKED HEFS_SLICE_NODE {
- UInt32 fBase;
- UInt32 fLength;
-};
-
/// @brief Journal Node structure
/// @param fHashPath target hash path
/// @param fStatus target status
@@ -178,10 +171,7 @@ struct PACKED HEFS_INDEX_NODE final { UInt32 fOffsetSliceLow;
UInt32 fOffsetSliceHigh;
- ATTRIBUTE(deprecated)
- HEFS_SLICE_NODE fSlices[kHeFSSliceCount]; /// @brief block slice, unused as of current HeFS.
-
- Char fPad[309];
+ Char fPad[437];
};
enum {
diff --git a/dev/kernel/HALKit/AMD64/HalDebugOutput.cc b/dev/kernel/HALKit/AMD64/HalDebugOutput.cc index 71dee911..bd8fe734 100644 --- a/dev/kernel/HALKit/AMD64/HalDebugOutput.cc +++ b/dev/kernel/HALKit/AMD64/HalDebugOutput.cc @@ -108,7 +108,6 @@ EXTERN_C void ke_io_write(IDeviceObject<const Char*>* obj, const Char* bytes) { len = rt_string_len(bytes); STATIC SizeT x = kFontSizeX, y = kFontSizeY; - STATIC BOOL not_important = YES; while (index < len) { if (bytes[index] == '\r') HAL::rt_out8(Detail::kPort, '\r'); @@ -119,18 +118,7 @@ EXTERN_C void ke_io_write(IDeviceObject<const Char*>* obj, const Char* bytes) { tmp_str[0] = bytes[index]; tmp_str[1] = 0; - if (bytes[index] == '*') { - if (not_important) - not_important = NO; - else - not_important = YES; - - ++index; - - continue; - } - - fb_render_string(tmp_str, y, x, not_important ? RGB(0xff, 0xff, 0xff) : RGB(0xff, 0x00, 0x00)); + fb_render_string(tmp_str, y, x, RGB(0xff, 0xff, 0xff)); if (bytes[index] == '\r') { y += kFontSizeY; diff --git a/dev/kernel/src/FS/HeFS+FileSystemParser.cc b/dev/kernel/src/FS/HeFS+FileSystemParser.cc index fa82320f..e91040b2 100644 --- a/dev/kernel/src/FS/HeFS+FileSystemParser.cc +++ b/dev/kernel/src/FS/HeFS+FileSystemParser.cc @@ -800,8 +800,8 @@ _Output Bool HeFileSystemParser::Format(_Input _Output DriveTrait* mnt, _Input c /// @note all HeFS strucutres are equal to 512, so here it's fine, unless fSectoSize is 2048. const SizeT max_lba = drv_std_get_size() / root->fSectorSize; - const SizeT dir_max = max_lba / 5; // 20% for directory inodes - const SizeT inode_max = max_lba / 3; // 30% for inodes + const SizeT dir_max = max_lba / 20; // 20% for directory inodes + const SizeT inode_max = max_lba / 30; // 30% for inodes root->fStartIND = mnt->fLbaStart + kHeFSINDStartOffset; root->fEndIND = root->fStartIND + dir_max; @@ -954,7 +954,7 @@ _Output Bool HeFileSystemParser::CreateINode(_Input DriveTrait* mnt, _Input cons _Output Bool HeFileSystemParser::INodeManip(_Input DriveTrait* mnt, VoidPtr block, SizeT block_sz, const Utf8Char* dir, const Utf8Char* name, - const UInt8 kind, const BOOL in) { + const UInt8 kind, const BOOL is_input) { if (urt_string_len(dir) > kHeFSFileNameLen) { err_global_get() = kErrorDisk; return NO; @@ -999,7 +999,7 @@ _Output Bool HeFileSystemParser::INodeManip(_Input DriveTrait* mnt, VoidPtr bloc mnt->fPacket.fPacketSize = block_sz; mnt->fPacket.fPacketContent = block; - if (in) { + if (is_input) { mnt->fInput(mnt->fPacket); } else { mnt->fOutput(mnt->fPacket); @@ -1137,7 +1137,26 @@ Boolean fs_init_hefs(Void) { MUST_PASS(parser.INodeManip(&kMountPoint, contents_1, kHeFSBlockLen, u8"/boot", u8"bootinfo.cfg", kHeFSFileKindRegular, YES)); - kout8 << contents_1 << kendl8; + if (*contents_1 != u'\0') { + (Void)(kout << "/boot/bootinfo.cfg:" << kendl); + (Void)(kout8 << contents_1 << kendl8); + } else { + auto src = + u8"[boot]\r" + u8"path=bootz.efi\r" + u8"name=BootZ\r" + u8"[kernel]\r" + u8"path=krnl.efi\r" + u8"name=NeKernel\r" + u8"[chk]\r" + u8"path=chk.efi\r" + u8"name=SysChk\r"; + + urt_copy_memory((VoidPtr) src, contents_1, urt_string_len(src)); + + MUST_PASS(parser.INodeManip(&kMountPoint, contents_1, kHeFSBlockLen, u8"/boot", + u8"bootinfo.cfg", kHeFSFileKindRegular, NO)); + } return YES; } diff --git a/dev/kernel/src/UtfUtils.cc b/dev/kernel/src/UtfUtils.cc index ed0e4591..11d7471a 100644 --- a/dev/kernel/src/UtfUtils.cc +++ b/dev/kernel/src/UtfUtils.cc @@ -10,7 +10,7 @@ namespace Kernel { Size urt_string_len(const Utf8Char* str) { SizeT len{0}; - while (str[len] != u'\0') ++len; + while (str[len] != u8'\0') ++len; return len; } |
