From 708765621ede3541037fb822cc032b9feb2ea43e Mon Sep 17 00:00:00 2001 From: Alexis211 Date: Sun, 13 Sep 2009 16:46:15 +0200 Subject: Kernel can now load an Initrd. --- Source/Tools/MakeRamFS/MakeRamFS | Bin 12236 -> 12483 bytes Source/Tools/MakeRamFS/main.cpp | 9 +++++++-- 2 files changed, 7 insertions(+), 2 deletions(-) (limited to 'Source/Tools') diff --git a/Source/Tools/MakeRamFS/MakeRamFS b/Source/Tools/MakeRamFS/MakeRamFS index 43a628b..be1dc1a 100755 Binary files a/Source/Tools/MakeRamFS/MakeRamFS and b/Source/Tools/MakeRamFS/MakeRamFS differ diff --git a/Source/Tools/MakeRamFS/main.cpp b/Source/Tools/MakeRamFS/main.cpp index df1f0d8..dcb2a2b 100644 --- a/Source/Tools/MakeRamFS/main.cpp +++ b/Source/Tools/MakeRamFS/main.cpp @@ -50,6 +50,7 @@ int main(int argc, char *argv[]) { fhdr.file_length = 0; //File length of 0 means directory output.write((char*)&fhdr, sizeof(ramfs_file_header)); output << name; + output << '\0'; continue; } @@ -75,10 +76,14 @@ int main(int argc, char *argv[]) { output.write((char*)&fhdr, sizeof(ramfs_file_header)); output << name; + output << '\0'; char *c = new char[fhdr.file_length]; - infile.read(c, fhdr.file_length); - output.write(c, fhdr.file_length); + for (int i = 0; i < fhdr.file_length; i++) { + char ch; + infile.read(&ch, 1); + output.write(&ch, 1); + } delete [] c; infile.close(); -- cgit v1.2.3