summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexis211 <alexis211@gmail.com>2009-09-13 18:47:37 +0200
committerAlexis211 <alexis211@gmail.com>2009-09-13 18:47:37 +0200
commitd25429b738cb9c1b34d234ae23b3af27fdff72ea (patch)
treec15ef84225ad8e1e1670da309ad73bcd323c4956
parent23c20becb3542c7d5fa041ec69902abe8e2c8d64 (diff)
downloadMelon-d25429b738cb9c1b34d234ae23b3af27fdff72ea.tar.gz
Melon-d25429b738cb9c1b34d234ae23b3af27fdff72ea.zip
Changed welcome text and added a few error messages.
-rw-r--r--Init.rfsbin157 -> 564 bytes
-rw-r--r--Source/Kernel/Core/kmain.wtf.cpp22
-rwxr-xr-xSource/Kernel/Melon.kebin167382 -> 167382 bytes
-rw-r--r--Source/Kernel/Ressources/Welcome.txt13
4 files changed, 26 insertions, 9 deletions
diff --git a/Init.rfs b/Init.rfs
index cec0405..3c29618 100644
--- a/Init.rfs
+++ b/Init.rfs
Binary files differ
diff --git a/Source/Kernel/Core/kmain.wtf.cpp b/Source/Kernel/Core/kmain.wtf.cpp
index 808e254..59d74b5 100644
--- a/Source/Kernel/Core/kmain.wtf.cpp
+++ b/Source/Kernel/Core/kmain.wtf.cpp
@@ -164,14 +164,19 @@ void kmain(multiboot_info_t* mbd, u32int magic) {
}
}
} else if (tokens[0] == "cd") {
- FSNode* n = VFS::find(tokens[1], cwd);
- if (n == NULL)
- *kvt << "No such directory : " << tokens[1] << "\n";
- else if (n->type() != NT_DIRECTORY)
- *kvt << "Not a directory : " << tokens[1] << "\n";
- else
- cwd = (DirectoryNode*)n;
+ if (tokens.size() == 1) {
+ *kvt << "Where shall I take you, sir ?\n";
+ } else {
+ FSNode* n = VFS::find(tokens[1], cwd);
+ if (n == NULL)
+ *kvt << "No such directory : " << tokens[1] << "\n";
+ else if (n->type() != NT_DIRECTORY)
+ *kvt << "Not a directory : " << tokens[1] << "\n";
+ else
+ cwd = (DirectoryNode*)n;
+ }
} else if (tokens[0] == "cat") {
+ if (tokens.size() == 1) *kvt << "Meow.\n";
for (u32int i = 1; i < tokens.size(); i++) {
FSNode* n = VFS::find(tokens[i], cwd);
if (n == NULL) {
@@ -180,8 +185,9 @@ void kmain(multiboot_info_t* mbd, u32int magic) {
*kvt << "Not a file : " << tokens[1] << "\n";
} else {
FileNode* f = (FileNode*) n;
- u8int *buff = (u8int*)Mem::kalloc(f->getLength());
+ u8int *buff = (u8int*)Mem::kalloc(f->getLength() + 1);
f->read(0, f->getLength(), buff);
+ buff[f->getLength()] = 0;
*kvt << String((const char*) buff);
Mem::kfree(buff);
}
diff --git a/Source/Kernel/Melon.ke b/Source/Kernel/Melon.ke
index 418c1a8..59e3b8b 100755
--- a/Source/Kernel/Melon.ke
+++ b/Source/Kernel/Melon.ke
Binary files differ
diff --git a/Source/Kernel/Ressources/Welcome.txt b/Source/Kernel/Ressources/Welcome.txt
index 97d6755..9af0942 100644
--- a/Source/Kernel/Ressources/Welcome.txt
+++ b/Source/Kernel/Ressources/Welcome.txt
@@ -1 +1,12 @@
-Hi, this is a file located on an InitRD ! éàç...
+EN :
+Welcome on this Melon live-floppy ! For the moment, the project isn't very
+advanced, but if you can read this text, it's already because of a lot of
+great efforts I'v made for developping this.
+
+FR :
+Bienvenue sur cette live-disquette de Melon ! Pour l'instant, le projet
+n'est pas très avancé, mais si vous pouvez lire ce texte, c'est déjà grâce
+à un grand travail de ma part dans le développement.
+
+ES :
+[I can't speak Spanish properly, sorry]