summaryrefslogtreecommitdiff
path: root/Source/Tools/MakeRamFS
diff options
context:
space:
mode:
authorAlexis211 <alexis211@gmail.com>2009-09-13 16:46:15 +0200
committerAlexis211 <alexis211@gmail.com>2009-09-13 16:46:15 +0200
commit708765621ede3541037fb822cc032b9feb2ea43e (patch)
tree12e0e6c936fba8092479baf31d2ac4dc4ea9ed0f /Source/Tools/MakeRamFS
parentace1914398633e05970f634ddec297665dfda7c6 (diff)
downloadMelon-708765621ede3541037fb822cc032b9feb2ea43e.tar.gz
Melon-708765621ede3541037fb822cc032b9feb2ea43e.zip
Kernel can now load an Initrd.
Diffstat (limited to 'Source/Tools/MakeRamFS')
-rwxr-xr-xSource/Tools/MakeRamFS/MakeRamFSbin12236 -> 12483 bytes
-rw-r--r--Source/Tools/MakeRamFS/main.cpp9
2 files changed, 7 insertions, 2 deletions
diff --git a/Source/Tools/MakeRamFS/MakeRamFS b/Source/Tools/MakeRamFS/MakeRamFS
index 43a628b..be1dc1a 100755
--- a/Source/Tools/MakeRamFS/MakeRamFS
+++ b/Source/Tools/MakeRamFS/MakeRamFS
Binary files 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();