1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 20:37:35 +00:00

Print the contents of motd.txt on boot.

This commit is contained in:
Andreas Kling 2018-10-17 12:07:39 +02:00
parent 705832f387
commit 39fa1eb2c2
5 changed files with 28 additions and 8 deletions

View file

@ -42,7 +42,7 @@ boot:
inc word [cur_lba]
mov cx, word [cur_lba]
cmp cx, 300
cmp cx, 400
jz .sector_loop_end
mov bx, es

View file

@ -30,7 +30,8 @@ VFS_OBJS = \
../VirtualFileSystem/DiskBackedFileSystem.o \
../VirtualFileSystem/Ext2FileSystem.o \
../VirtualFileSystem/InodeIdentifier.o \
../VirtualFileSystem/VirtualFileSystem.o
../VirtualFileSystem/VirtualFileSystem.o \
../VirtualFileSystem/FileHandle.o
AK_OBJS = \
../AK/String.o \

View file

@ -1,6 +1,7 @@
#include "types.h"
#include "Assertions.h"
#include "kmalloc.h"
#include <AK/Types.h>
void memcpy(void *dest, const void *src, DWORD n)
{
@ -51,11 +52,13 @@ char* strdup(const char *str)
int memcmp(const void* v1, const void* v2, size_t n)
{
size_t m;
const char* s1 = (const char*)v1;
const char* s2 = (const char*)v2;
for (m = 0; m < n && *s1 == *s2; ++s1, ++s2);
return m == n ? 0 : -1;
auto* s1 = (const byte*)v1;
auto* s2 = (const byte*)v2;
while (n-- > 0) {
if (*s1++ != *s2++)
return s1[-1] < s2[-1] ? -1 : 1;
}
return 0;
}
extern "C" void __cxa_pure_virtual()

View file

@ -20,6 +20,7 @@
#include <VirtualFileSystem/RandomDevice.h>
#include <VirtualFileSystem/Ext2FileSystem.h>
#include <VirtualFileSystem/VirtualFileSystem.h>
#include <VirtualFileSystem/FileHandle.h>
#include <AK/OwnPtr.h>
#if 0
@ -154,6 +155,16 @@ void init()
vfs->listDirectory("/");
{
auto motdFile = vfs->open("/motd.txt");
ASSERT(motdFile);
auto motdData = motdFile->readEntireFile();
for (unsigned i = 0; i < motdData.size(); ++i) {
kprintf("%c", motdData[i]);
}
}
// The idle task will spend its eternity here for now.
for (;;) {
asm("hlt");