diff --git a/Build/loader.o b/Build/loader.o index b125264..c47ad8b 100644 Binary files a/Build/loader.o and b/Build/loader.o differ diff --git a/Build/main.o b/Build/main.o index 596f6bd..c9b39ef 100644 Binary files a/Build/main.o and b/Build/main.o differ diff --git a/Kernel/debug/commands.c b/Kernel/debug/commands.c index 06ea81d..7393ead 100644 --- a/Kernel/debug/commands.c +++ b/Kernel/debug/commands.c @@ -54,7 +54,7 @@ void CommandTime() }; - Time time = TimeConvertToTime(TimeGetInternalTime()); + Time time = ConvertTimeSystemToTime(TimeGetInternalTime()); ConsoleWrite ("Current time: "); ConsoleWrite ("%#%d:%d%d:%d%d.%d%d%d\n", Color(0,ColorLightGreen) ,(int)time.Hour, diff --git a/Kernel/drivers/drivers.c b/Kernel/drivers/drivers.c index 2f03bae..fd4e1ff 100644 --- a/Kernel/drivers/drivers.c +++ b/Kernel/drivers/drivers.c @@ -15,7 +15,7 @@ void DriversInstall_Clock() Time time; CmosGetRTC(&time); - TimeSetInternalTime(TimeConvertToTimeSystem(time)); + TimeSetInternalTime(ConvertTimeToTimeSystem(time)); Log("%#[Drivers] %#Read RTC time: ", ColorWhite, ColorLightGray); Log("%#%u/%u/%u %u:%u:%u.%u\n", ColorLightCyan, time.Month, time.Day, diff --git a/Kernel/hal/filesys/fat12.c b/Kernel/hal/filesys/fat12.c new file mode 100644 index 0000000..df8ad6d --- /dev/null +++ b/Kernel/hal/filesys/fat12.c @@ -0,0 +1,8 @@ +/* + * fat12.c + * + * Created on: Aug 29, 2011 + * Author: Tiberiu + */ + + diff --git a/Kernel/hal/hal.c b/Kernel/hal/hal.c index db51fe8..a290d7d 100644 --- a/Kernel/hal/hal.c +++ b/Kernel/hal/hal.c @@ -8,6 +8,7 @@ #include "keyboard/keyboard.h" #include "mouse/mouse.h" +#include #include void HalInitialize() @@ -32,4 +33,7 @@ void HalInitialize() // Install mouse driver MouseInstall(); Log("%#[HAL] %#Installed mouse driver\n", ColorYellow, ColorLightGreen); + + // Install VFS + VfsInstall(); } diff --git a/Kernel/hal/sysinfo.c b/Kernel/hal/reboot.c similarity index 81% rename from Kernel/hal/sysinfo.c rename to Kernel/hal/reboot.c index 8529f4c..71733d8 100644 --- a/Kernel/hal/sysinfo.c +++ b/Kernel/hal/reboot.c @@ -8,13 +8,9 @@ */ #include -#include #include -#include - -#include <../drivers/cmos/cmos.h> - #include "keyboard/keyboard.h" + void SystemReboot() { Log("Rebooting system...\n"); diff --git a/Kernel/hal/vfs.c b/Kernel/hal/vfs.c index 23000df..9f9f248 100644 --- a/Kernel/hal/vfs.c +++ b/Kernel/hal/vfs.c @@ -1,40 +1,208 @@ -#include -#include +#include +#include +#include +#include #define MAX_FS_COUNT 64 +#define BAD 0xffffffff -uint32 FsRead(FsNode *node, uint32 offset, uint32 size, uint8 *buffer) +FileSystem* fsArray; +uint32 fsCount; + +MountPoint* mpArray; +uint32 mpCount; +uint32 mpAllocated; + +#define LogVfs(...) { Log("%#[Vfs] ", ColorLightBlue); Log(__VA_ARGS__); } +#define ErrorVfs(...) { Error("%#[Vfs] ", ColorLightBlue); Error(__VA_ARGS__); } + +void VfsInstall () { - if (node->Read != NULL) return node->Read(node, offset, size, buffer); - return NULL; + fsArray = (FileSystem*) kmalloc(MAX_FS_COUNT * sizeof(FileSystem)); + fsCount = 0; + + mpArray = (MountPoint*) kmalloc(32 * sizeof(MountPoint)); + mpCount = 0; + mpAllocated = 32; + + LogVfs("%#VFS now in business.\n", ColorLightGreen); } -uint32 FsWrite(FsNode *node, uint32 offset, uint32 size, uint8 *buffer) +uint8 VfsInstallFs (FileSystem* fs) { - if (node->Write != NULL) return node->Write(node, offset, size, buffer); - return NULL; + if (fsCount >= MAX_FS_COUNT) { + ErrorVfs("%#Failed to install file system '%s': FS count reached.\n", ColorLightRed, fs->Name); + return 0; + } + + memcpy(&fsArray[fsCount], fs, sizeof(FileSystem)); + fsArray[fsCount].Id = fsCount; + + ++fsCount; + LogVfs("Installed file system %#.\n", ColorWhite, fs->Name); + return 1; } -void FsOpen(FsNode *node, uint8 read, uint8 write) +uint32 VfsFindDevice (string dev) { - if (node->Open != NULL) return node->Open(node, read, write); + uint32 i; + for (i = 0; i < mpCount; i++) + if (strcmp(dev, mpArray[i].Name) == 0) + return i; + + return BAD; } -void FsClose(FsNode *node) + +// Returns mount point index, removes dev name from path +uint32 VfsParsePath (string* path) { - if (node->Close != NULL) return node->Close(); + // Sanity check + if (!path || !(*path)) return BAD; + + string dev = *path, p = strchr(*path, ':'); + if (p == NULL) return BAD; // invalid path + + // Split string + *path = p+1; *p = '\0'; + + return VfsFindDevice(dev); } -DirectoryEntry *FsReadDir(FsNode *node, uint32 index) +uint8 VfsMount (string Name, DevReadRoutine R, DevWriteRoutine W, uint32 BlockSize) { - if (node->ReadDir != NULL && (node->Flags&7) == FsDirectory) - return node->ReadDir(node, index); - return NULL; + uint32 i, fsId = BAD, mpIndex = BAD; + + // Try to figure out the file system + for (i = 0; i < fsCount && fsId == BAD; i++) + if (fsArray->Detect && fsArray->Detect(R, BlockSize)) fsId = i; + + if (fsId == BAD) { + ErrorVfs("%#Failed to mount device %s: no file system found.\n", ColorLightRed, Name) + return 0; // No file system, no good + } + + // Try to find an empty slot to fill + for (i = 0; i < mpCount && mpIndex == BAD; i++) + if (mpArray[i].Id == BAD) mpIndex = i; + + // No empty slots? + if (mpIndex == BAD) + { + // Make sure we have enough space + if (mpCount == mpAllocated) { + mpAllocated += 4; + mpArray = kmrealloc(mpArray, mpAllocated * sizeof(MountPoint)); + } + + mpIndex = mpCount++; + } + + // Add to mount point list, set up data + mpArray[mpIndex].Id = mpIndex; + mpArray[mpIndex].FsId = fsId; + mpArray[mpIndex].BlockSize = BlockSize; + mpArray[mpIndex].Read = R; + mpArray[mpIndex].Write = W; + + // Change name if it already exists + uint32 find = VfsFindDevice(Name); + if (find != BAD) + { + uint32 len = strlen(Name); + uint8 success = 0; + Name[len+1] = '\0'; + + // Try to find a number index + for (find = '0'; find <= '9' && !success; find++) + { + Name[len] = find; + if (VfsFindDevice(Name) == BAD) success = 1; + } + + // What? Haven't found anything yet? Try the alphabet + for (find = 'a'; find <= 'z' && !success; find++) + { + Name[len] = find; + if (VfsFindDevice(Name) == BAD) success = 1; + } + + // Still nothing? How in the world is this even possible ?!?!?! + if (!success) return 0; + } + + memcpy(mpArray[mpCount].Name, Name, sizeof(char) * 128); + + LogVfs("Mounted device %#%s", ColorWhite, Name); + return 1; } -FsNode *FsFindDir(FsNode *node, char *name) +void VfsUnmount (uint32 dev_id) { - if (node->FindDir != NULL && (node->Flags&7) == FsDirectory) - return node->FindDir(node, name); - return NULL; + mpArray[dev_id].Id = BAD; + mpCount--; +} + +// Returns pointer to FILE structure that was inputed if success, null otherwise +FILE* VfsOpen (FILE* file, string path) +{ + if (!file) return NULL; + + // Parse string + uint32 dev = VfsParsePath(&path); + file->DeviceId = dev; + + // Device not found, or Open routine doesn't exist + if (dev == BAD || !fsArray[mpArray[dev].FsId].Open) return NULL; + + // Ask the FS to do the 'opening' + return fsArray[mpArray[dev].FsId].Open(&mpArray[dev],file,path); +} + +DirectoryEntry* VfsTest (string path) +{ + // Parse string + uint32 dev = VfsParsePath(&path); + + // Device not found, or Open routine doesn't exist + if (dev == BAD || !fsArray[mpArray[dev].FsId].Test) return NULL; + + // Ask the FS to do the 'opening' + return fsArray[mpArray[dev].FsId].Test(&mpArray[dev],path); +} + +FILE* VfsClose (FILE* file) +{ + if (!file) return NULL; + MountPoint* mp = &(mpArray[file->DeviceId]); + + if (!fsArray[mp->FsId].Close) return NULL; + return fsArray[mp->FsId].Close(mp,file); +} + +uint32 VfsRead (FILE* file, uint32 bsz, uint32 n, uint8* buffer) +{ + if (!file) return NULL; + MountPoint* mp = &(mpArray[file->DeviceId]); + + if (!fsArray[mp->FsId].Read) return NULL; + return fsArray[mp->FsId].Read(mp, file, bsz, n, buffer); +} + +uint32 VfsWrite (FILE* file, uint32 bsz, uint32 n, uint8* buffer) +{ + if (!file) return NULL; + MountPoint* mp = &(mpArray[file->DeviceId]); + + if (!fsArray[mp->FsId].Write) return NULL; + return fsArray[mp->FsId].Write(mp, file, bsz, n, buffer); +} + +DirectoryEntry* VfsReadDirectory (FILE* handle, uint32 index) +{ + if (!handle) return NULL; + MountPoint* mp = &(mpArray[handle->DeviceId]); + + if (!fsArray[mp->FsId].ReadDirectory) return NULL; + return fsArray[mp->FsId].ReadDirectory(mp, handle, index); } diff --git a/Kernel/include/fileio.h b/Kernel/include/fileio.h index 0858ea9..ce9a5f2 100644 --- a/Kernel/include/fileio.h +++ b/Kernel/include/fileio.h @@ -9,62 +9,114 @@ #define FILEIO_H_ #include +#include -enum FsFlags +// Device routines, will read/write 'BlockSize' bytes per call +typedef uint32 (*DevReadRoutine)(uint32 offset, void* buffer); +typedef uint32 (*DevWriteRoutine)(uint32 offset, void* buffer); + +enum FileFlags { - FsFile = 0x1, - FsDirectory = 0x2, - FsCharDevice = 0x3, - FsBlockDevice = 0x4, - FsPipe = 0x5, - FsSymbolLink = 0x6, - FsMountPoint = 0x8 + FileFile = 0x1, + FileDirectory = 0x2, + FileCharDevice = 0x3, + FileBlockDevice = 0x4, + FilePipe = 0x5, + FileSymbolLink = 0x6, + FileMountPoint = 0x7, + FileOwnerRead = 0x8, + FileOwnerWrite = 0x10, + FileOwnerExecute = 0x20, + FileGroupRead = 0x40, + FileGroupWrite = 0x80, + FileGroupExecute = 0x100, + FileOtherRead = 0x200, + FileOtherWrite = 0x400, + FileOtherExecute = 0x800, + FileHidden = 0x1000, }; -typedef uint32 (*ReadRoutine)(struct _FsNode*, uint32, uint32, uint8*); -typedef uint32 (*WriteRoutine)(struct _FsNode*, uint32, uint32, uint8*); -typedef void (*OpenRoutine)(struct _FsNode*); -typedef void (*CloseRoutine)(struct _FsNode*); -typedef struct _DirectoryEntry (*ReadDirRoutine)(struct _FsNode*,uint32); -typedef struct _FsNode* (*FindDirRoutine)(struct _FsNode*,char *name); -typedef struct _FsNode +typedef struct _FILE { - char Name[128]; // The filename. - uint32 Permissions; // The permissions mask. - uint32 UserId; // The owning user. - uint32 GroupId; // The owning group. - uint32 Flags; // Includes the node type. See enum above. - uint32 INode; // This is device-specific - provides a way for a filesystem to identify files. - uint32 Length; // Size of the file, in bytes. - uint32 Implementation; // An implementation-defined number. - ReadRoutine Read; - WriteRoutine Write; - OpenRoutine Open; - CloseRoutine Close; - ReadDirRoutine ReadDir; - FindDirRoutine FindDir; - struct _FsNode *Ptr; // Used by mountpoints and symlinks. -} FsNode; + uint32 DeviceId; // The VFS identifies the mounted device that uses this + uint32 Id; // The FS idenitifies files using this field + char Name[128]; + + /*** Looks like this: + * bits description + * 0-2 file type + * 3-5 owner permissions (rwx) + * 6-8 group permissions (rwx) + * 9-11 other permissions (rwx) + * 12 hidden + * 13-31 (unassigned yet) + * + * Note: In windows FS, the readonly and system attributes are set using permissions and userid */ + uint32 Flags; + uint32 OwnerId, GroupId; + uint32 Size; +} FILE; typedef struct _DirectoryEntry { char Name[128]; - uint32 INode; + uint32 Flags, OwnerId, GroupId, Size; + TimeSystem TimeCreated, TimeModified, TimeAccessed; + } DirectoryEntry; -extern uint32 FsRead(FsNode *node, uint32 offset, uint32 size, uint8 *buffer); -extern uint32 FsWrite(FsNode *node, uint32 offset, uint32 size, uint8 *buffer); -extern void FsOpen(FsNode *node, uint8 read, uint8 write); -extern void FsClose(FsNode *node); -extern DirectoryEntry *FsReadDir(FsNode *node, uint32 index); -extern FsNode *FsFindDir(FsNode *node, char *name); +typedef struct { + uint32 Id; + uint32 FsId; + char Name[128]; + + uint32 BlockSize; + DevReadRoutine Read; + DevWriteRoutine Write; +} MountPoint; + + +// File system routines +typedef uint32 (*FsReadRoutine)(const MountPoint*, FILE*, uint32, uint32, uint8*); +typedef uint32 (*FsWriteRoutine)(const MountPoint*, FILE*, uint32, uint32, uint8*); +typedef FILE* (*FsOpenRoutine)(const MountPoint*, FILE*,string); +typedef DirectoryEntry* (*FsTestRoutine)(const MountPoint*, string); // Test if a file exists, and returns info +typedef FILE* (*FsCloseRoutine)(const MountPoint*, FILE*); +typedef DirectoryEntry* (*FsReadDirRoutine)(const MountPoint*,FILE*,uint32); + +typedef uint32 (*FsDetectRoutine) (DevReadRoutine, uint32 blocksz); + +// File system structure +typedef struct { + uint32 Id; + char Name[16]; + + FsDetectRoutine Detect; + FsOpenRoutine Open; + FsCloseRoutine Close; + FsReadRoutine Read; + FsWriteRoutine Write; + FsTestRoutine Test; // See if file exists without having to open it + FsReadDirRoutine ReadDirectory; +} FileSystem; + + +// Vfs routines +extern void VfsInstall (); +extern uint8 VfsInstallFs (FileSystem* fs); +extern uint32 VfsFindDevice (string dev); +extern uint32 VfsParsePath (string* path); +extern uint8 VfsMount (string Name, DevReadRoutine R, DevWriteRoutine W, uint32 BlockSize); +extern void VfsUnmount (uint32 dev_id); +extern FILE* VfsOpen (FILE* file, string path); +extern DirectoryEntry* VfsTest (string path); +extern FILE* VfsClose (FILE* file); +extern uint32 VfsRead (FILE* file, uint32 bsz, uint32 n, uint8* buffer); +extern uint32 VfsWrite (FILE* file, uint32 bsz, uint32 n, uint8* buffer); +extern DirectoryEntry* VfsReadDirectory (FILE* handle, uint32 index); -#ifdef NEVER -void VfsRegisterFilesys(); -void VfsMount(); -#endif #endif /* FILEIO_H_ */ diff --git a/Kernel/include/memory-add.h~ b/Kernel/include/memory-add.h~ deleted file mode 100644 index acd3a39..0000000 --- a/Kernel/include/memory-add.h~ +++ /dev/null @@ -1,96 +0,0 @@ -/* - * memory-add.h - * - * Created on: Aug 27, 2011 - * Author: Tiberiu - */ - -#ifndef MEMORY_ADD_H_ -#define MEMORY_ADD_H_ - -#include -#include -#include - -/*************************************************** - * Paging * - ***************************************************/ -typedef uint32 Page; - -enum PageFlags -{ - PagePresent = 0x1, - PageWriteable = 0x2, - PageUser = 0x4, - PageWriteThough = 0x8, - PageNotCacheable = 0x10, - PageAccessed = 0x20, - PageDirty = 0x40, - PagePAT = 0x80, - PageCpuGlobal = 0x100, - PageLvl4Global = 0x200, - PageFrame = 0xFFFFF000 -}; - - - -typedef struct { - Page Pages[1024]; -} PageTable; - -typedef struct { - PageTable* Tables[1024]; - uint32 TablesPhysical[1024]; - uint32 PhysicalAddr; -} PageDirectory; - -extern PageDirectory* CurrentDirectory; -extern PageDirectory* KernelDirectory; - -extern void PagingInitialize(uint32 SystemMemory); -extern void PagingSwitchPageDirectory (PageDirectory* dir); -extern Page* PagingGetPage(uint32 addr, uint8 make, PageDirectory* dir); - - -/*************************************************** - * Physical memory manager * - ***************************************************/ -extern uint32 TotalFrames; -extern uint32 TotalMemory; - -void MemPhInitialize(uint32 SystemMemoryKb); -extern void MemPhSetFrame (uint32 frame, uint8 value); -uint32 MemPhGetFrame (uint32 frame); -uint32 MemPhFindFreeFrame(); -void MemPhAllocFrame(Page* page, uint8 isKernel, uint8 isWriteable); -void MemPhFreeFrame(Page* page); -void MemPhReserveFrames (uint32 address, uint32 length); - - -/*************************************************** - * Memory heap * - ***************************************************/ -typedef struct -{ - OrderedArray Index; - uint32 StartAddress, EndAddress, MaxAddress; - // bit 0: supervisor-only bit 1: read-only - uint8 Flags; -} MemHeap; - -extern MemHeap* KernelHeap; - -extern uint32 MemHeapFindSmallestHole (uint32 size, uint8 page_align, MemHeap* heap); -extern int32 MemHeapCompare (uint32 a, uint32 b); -extern MemHeap* MemHeapCreate(uint32 start, uint32 end, uint32 max, uint8 flags); -extern void MemHeapExpand(uint32 newsz, MemHeap* heap, PageDirectory* pd); -extern uint32 MemHeapContract(uint32 newsz, MemHeap* heap, PageDirectory* pd); -extern uint32 MemHeapAlloc (uint32 size, uint8 isPageAligned, MemHeap* heap, PageDirectory* pd); -extern void MemHeapFree (uint32 address, MemHeap* heap, PageDirectory* pd); - - -#define LogMem(...) { Log("%#[Mem] ", ColorLightCyan); Log(__VA_ARGS__); } -#define ErrorMem(...) { Error("%#[Mem] ", ColorLightCyan); Error(__VA_ARGS__); } - - -#endif /* MEMORY_ADD_H_ */ diff --git a/Kernel/include/memory.h b/Kernel/include/memory.h index 0630375..8349daf 100644 --- a/Kernel/include/memory.h +++ b/Kernel/include/memory.h @@ -12,6 +12,7 @@ extern void* kmalloc (uint32 size); extern void* kmalloc_a (uint32 size); extern void* kmalloc_p (uint32 size, uint32* phys); extern void* kmalloc_ap (uint32 size, uint32* phys); +extern void* kmrealloc (void* original, uint32 newsz); extern void kfree (void* addr); extern void MemoryTempInitialize (uint32 kernel_end); diff --git a/Kernel/include/memory.h~ b/Kernel/include/memory.h~ deleted file mode 100644 index 35992b7..0000000 --- a/Kernel/include/memory.h~ +++ /dev/null @@ -1,29 +0,0 @@ -#ifndef __MEMORY__H -#define __MEMORY__H - -#include -#include -#include - -/*************************************************** - * Basic memory operations: alloc, free * - ***************************************************/ -extern void* kmalloc (uint32 size); -extern void* kmalloc_a (uint32 size); -extern void* kmalloc_p (uint32 size, uint32* phys); -extern void* kmalloc_ap (uint32 size, uint32* phys); -extern void kfree (void* addr); - -extern void MemoryTempInitialize (uint32 kernel_end); -extern void MemoryInitialize (MultibootInfo* info); - -extern uint32 MemoryGetTotal(); -extern uint32 MemoryGetFree(); // Returns total free physical memory in bytes -extern uint32 MemoryGetUsed(); // Total used physical memory in bytes -extern uint32 MemoryGetFrameSize(); // Same as above functions, but in frames -extern uint32 MemoryGetFramesTotal(); -extern uint32 MemoryGetFramesUsed(); -extern uint32 MemoryGetFramesFree(); - - -#endif diff --git a/Kernel/include/settings.h~ b/Kernel/include/settings.h~ deleted file mode 100644 index 30491f7..0000000 --- a/Kernel/include/settings.h~ +++ /dev/null @@ -1,37 +0,0 @@ -/* - * settings.h - * - * Created on: Aug 16, 2011 - * Author: Tiberiu - */ - -#ifndef SETTINGS_H_ -#define SETTINGS_H_ - -// OS info -#define OS_STRING "lux" -#define OS_VERSION "0.1 [pre-Alpha]" -#define OS_BUILD_DATE __DATE__ -#define OS_BUILD_TIME __TIME__ - -#include - -// Logger -#define VERBOSE_MODE 1 -#define VERBOSE_ERROR 1 -#define VERBOSE_PANIC 1 - - -// Clock -#define PIT_FREQUENCY 100 - -// Console -#define CONSOLE_MAX_PARAMS 32 -#define CONSOLE_DEFAULT_COLOR 0x7 - -// Memory manager -#define KERNEL_HEAP_START 0xC0000000 -#define KERNEL_HEAP_END 0xCFFFF000 -#define KERNEL_HEAP_INITIAL_SIZE 0x100000 - -#endif /* SETTINGS_H_ */ diff --git a/Kernel/include/stdlib.h b/Kernel/include/stdlib.h index 4239b52..eb69f19 100644 --- a/Kernel/include/stdlib.h +++ b/Kernel/include/stdlib.h @@ -24,6 +24,8 @@ extern uint32 strlen (string s); extern int32 strcmp (string a, string b); extern string strcpy (string s1, const string s2); +extern char* strchr (string s, int c); +extern char* strrchr (string s, int c); /*************************************************** * Number operations: len * diff --git a/Kernel/include/stdlib.h~ b/Kernel/include/stdlib.h~ deleted file mode 100644 index 7b0451a..0000000 --- a/Kernel/include/stdlib.h~ +++ /dev/null @@ -1,69 +0,0 @@ -#ifndef __STDLIB__H -#define __STDLIB__H - -#include - -#define IsDigit(c) (c >= '0' && c <= '9') -#define IsHexDigit(c) ( (c >= '0' && c <= '9') || (c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F') ) -#define IsUpper(c) (c >= 'A' && c <= 'Z') -#define IsLower(c) (c >= 'a' && c <= 'z') - -#define IsAlpha(c) (IsLower(c) || IsUpper(c)) -#define IsAlphaNum(c) (IsAlpha(c) || IsDigit(c)) - -#define ToLower(c) ((IsUpper(c)) ? (c - 'A' + 'a') : c) -#define ToUpper(c) ((IsLower(c)) ? (c - 'a' + 'A') : c) - -#define Max(a,b) ((a > b) ? (a) : (b)) -#define Min(a,b) ((a < b) ? (a) : (b)) -#define Abs(a) ((a < 0) ? (a * -1) : (a)) - -/*************************************************** - * String operations: len, cmp, cpy * - ***************************************************/ -extern uint32 strlen (string s); -extern int32 strcmp (string a, string b); -extern string strcpy (string s1, const string s2); - -/*************************************************** - * Number operations: len * - ***************************************************/ -extern uint32 numlen (int32 number, int32 base); -extern uint32 unumlen (uint32 number, int32 base); - -/*************************************************** - * Memory operations: cpy, cmp, set * - ***************************************************/ -void* memcpy (void *dest, const void *src, uint32 count); -int32 memcmp (const void *s1, const void *s2, uint32 count); -void* memset (void *dest, uint8 val, uint32 count); - -/*************************************************** - * Conversion operations: num-str/str-num * - ***************************************************/ -extern int32 ConvertIntToString (string buffer, int32 number, int32 base); -extern uint32 ConvertUIntToString (string buffer, uint32 number, int32 base); -extern int32 ConvertStringToInt (string buffer); -extern uint32 ConvertStringToUInt (string buffer); -extern uint32 ConvertStringToIntHex (string buffer); - -/*************************************************** - * Ordered array implementation * - ***************************************************/ -typedef int (*ComparePredicate) (uint32, uint32); -typedef struct { - uint32* Data; - uint32 Size; - uint32 SizeLimit; - ComparePredicate Compare; -} OrderedArray; - -extern OrderedArray OrderedArrayCreate (uint32 maxSize, ComparePredicate p); -extern OrderedArray OrderedArrayPlace (uint32 addr, uint32 maxSize, ComparePredicate p); -extern void OrderedArrayDispose (OrderedArray* arr); -extern uint32 OrderedArraySearch (uint32 key, OrderedArray* arr, ComparePredicate predicate); -extern void OrderedArrayInsert (uint32 item, OrderedArray* arr); -extern uint32 OrderedArrayLookup (uint32 index, OrderedArray* arr); -extern void OrderedArrayDeleteIndex (uint32 index, OrderedArray* arr); - -#endif diff --git a/Kernel/include/storage.h b/Kernel/include/storage.h index dde42b1..8b68a13 100644 --- a/Kernel/include/storage.h +++ b/Kernel/include/storage.h @@ -10,56 +10,6 @@ #include -// Storage device -typedef struct { - - char MountPointName[32];// E.g. "fd0"; you should avoid spaces, or special chars, or otherwise get weird paths like "Mom's floppy\virus.exe" - uint32 DeviceID; // Autocompleted by VFS - - uint32 BlockSize; // E.g. sector size - uint32 BlockCount; // How many blocks are loaded in memory per read - - /******************************************************** - * READ DATA * - * Params: * - * > offset: read starting from block ~ * - * Returns: address to data, NULL for error * - ********************************************************/ - uint32 (*ReadData) (uint32 offset); - - /******************************************************** - * WRITE DATA * - * Params: * - * > offset: write starting from block ~ * - * > address: where to write from * - * Returns: NULL for error * - ********************************************************/ - uint32 (*WriteData) (uint32 offset, uint32 address); - - uint32 FileSystemID; // Autocompleted by 'mount'... at least should be - -} StorageDevice; - - -typedef struct { - uint32 FileSystemID; // Autocompleted by VFS - - /******************************************************** - * DETECT IF THIS IS THE FS ON STORAGE DEVICE * - * Params: * - * > *s: Pointer to device info & routines * - * Returns: positive if match, NULL otherwise * - ********************************************************/ - uint32 (*Detect) (StorageDevice *s); - - uint32 (*Open) (StorageDevice *s, string path); - uint32 (*CreateNode) (StorageDevice *s, string path); - uint32 (*DeleteNode) (StorageDevice *s, string path); - -} FileSystem; - - - extern void ConvertLbaToChs(uint32 SectorsPerTrack, uint32 lba, uint32 *cyl, uint32 *head, uint32 *sector); #endif /* STORAGE_H_ */ diff --git a/Kernel/include/time.h b/Kernel/include/time.h index 2bdc562..26c122c 100644 --- a/Kernel/include/time.h +++ b/Kernel/include/time.h @@ -21,8 +21,8 @@ typedef struct _Time Time; typedef struct _TimeSystem TimeSystem; -extern TimeSystem TimeConvertToTimeSystem (Time t); -extern Time TimeConvertToTime (TimeSystem InternalTime); +extern TimeSystem ConvertTimeToTimeSystem (Time t); +extern Time ConvertTimeSystemToTime (TimeSystem InternalTime); extern uint16 TimeCalculateWeekday (Time t); extern TimeSystem TimeGetInternalTime(); diff --git a/Kernel/include/version.h b/Kernel/include/version.h index e987952..6fc1c9f 100644 --- a/Kernel/include/version.h +++ b/Kernel/include/version.h @@ -1 +1 @@ -#define OS_BUILD "0.1.0.450" +#define OS_BUILD "0.1.0.470" diff --git a/Kernel/include/version.h~ b/Kernel/include/version.h~ deleted file mode 100644 index 2c68073..0000000 --- a/Kernel/include/version.h~ +++ /dev/null @@ -1 +0,0 @@ --e #define OS_BUILD "0.1.0.418" diff --git a/Kernel/library/memory/memory_alloc.c b/Kernel/library/memory/memory_alloc.c index f630d70..d0f33cc 100644 --- a/Kernel/library/memory/memory_alloc.c +++ b/Kernel/library/memory/memory_alloc.c @@ -82,3 +82,12 @@ void* kmalloc_ap(uint32 size, uint32* phys) else ret = _malloc_init2(size,1,phys); return (void*)ret; } + +void* kmrealloc (void* original, uint32 newsz) +{ + void* re = kmalloc(newsz); + memcpy (re, original, newsz); + kfree(original); + + return re; +} diff --git a/Kernel/library/memory/memory_alloc.c~ b/Kernel/library/memory/memory_alloc.c~ deleted file mode 100644 index 3969298..0000000 --- a/Kernel/library/memory/memory_alloc.c~ +++ /dev/null @@ -1,87 +0,0 @@ -/* - * memory_alloc.c - * - * Created on: Aug 27, 2011 - * Author: Tiberiu - */ - -#include - -extern uint32 mem_kernel_end; -extern uint8 mem_initialized; - -// Used prior to proper initialization -uint32 _malloc_init1 (uint32 size, uint8 page_aligned) -{ - uint32 ret = mem_kernel_end; - - if (page_aligned && (ret & 0xfff)) ret = (ret & 0xfffff000) + 0x1000; - mem_kernel_end = size + ret; - - LogMem("%#Allocated %u bytes (%spage aligned) at end of kernel (0x%x).\n", ColorLightMagenta, size, ((page_aligned) ? "" : "not "), ret); - return (ret); -} - -uint32 _malloc_init2 (uint32 size, uint8 page_aligned, uint32* phys) -{ - uint32 ret = MemHeapAlloc(size, page_aligned, KernelHeap, KernelDirectory); - - if (phys) - { - Page *pg = PagingGetPage(ret, 0, KernelDirectory); - *phys = (*pg & PageFrame) + (ret & 0xFFF); - - LogMem("%#Allocated %u bytes (%spage aligned) at address 0x%x (phys=%x).\n", ColorLightMagenta, size, ((page_aligned) ? "" : "not "), ret, *phys); - } - - else { - LogMem("%#Allocated %u bytes (%spage aligned) at address 0x%x.\n", ColorLightMagenta, size, ((page_aligned) ? "" : "not "), ret); - } - - return ret; -} - -// Allocate 'size' bytes -void* kmalloc (uint32 size) -{ - if (!mem_initialized) return 0; - if (mem_initialized == 1) return (void*)_malloc_init1(size, 0); - - return (void*)_malloc_init2(size,0,0); -} - -// Allocate 'size' bytes, page aligned -void* kmalloc_a(uint32 size) -{ - if (!mem_initialized) return 0; - if (mem_initialized == 1) return (void*)_malloc_init1(size, 1); - - return (void*)_malloc_init2(size,1,0); -} - -void* kmalloc_p(uint32 size, uint32* phys) -{ - if (!mem_initialized) return 0; - if (mem_initialized == 1) { - *phys = _malloc_init1(size,0); - return (void*)(*phys); - } - - return (void*)_malloc_init2(size,0,phys); -} - -void* kmalloc_ap(uint32 size, uint32* phys) -{ - if (!mem_initialized) return 0; - - uint32 ret; - if (mem_initialized == 1) { - *phys = ret = _malloc_init1(size,1); - } - - else ret = _malloc_init2(size,1,phys); - - LogMem("%#kmalloc_ap requested, returned 0x%x, phys = 0x%x.\n", ColorMagenta, ret, *phys); - - return (void*)ret; -} diff --git a/Kernel/library/memory/memory_info.c~ b/Kernel/library/memory/memory_info.c~ deleted file mode 100644 index e035707..0000000 --- a/Kernel/library/memory/memory_info.c~ +++ /dev/null @@ -1,48 +0,0 @@ -/* - * memory_info.c - * - * Created on: Aug 27, 2011 - * Author: Tiberiu - */ - -#include -// MemoryGetFree(), MemoryGetTotal(), MemoryGet blah blah... - -// Returns total physical memory in bytes -uint32 MemoryGetTotal() -{ - return (TotalMemory); -} - -// Returns total free physical memory in bytes -uint32 MemoryGetFree() -{ - return (TotalFrames - UsedFrames) * 0x4; -} - -// Total used physical memory in bytes -uint32 MemoryGetUsed() -{ - return UsedFrames * 0x4; -} - -// Same as above functions, but in frames -uint32 MemoryGetFrameSize() -{ - return 0x1000; -} - -uint32 MemoryGetFramesTotal() -{ - return TotalFrames; -} - -uint32 MemoryGetFramesUsed() -{ - return UsedFrames; -} - -uint32 MemoryGetFramesFree() -{ - return (TotalFrames - UsedFrames); -} \ No newline at end of file diff --git a/Kernel/library/memory/memory_init.c~ b/Kernel/library/memory/memory_init.c~ deleted file mode 100644 index 0cf2f18..0000000 --- a/Kernel/library/memory/memory_init.c~ +++ /dev/null @@ -1,92 +0,0 @@ -/* - * memory-init.c - * - * Created on: Aug 27, 2011 - * Author: Tiberiu - */ -#include -#include -#include -#include "../../drivers/cmos/cmos.h" -#include - - -uint32 mem_kernel_end = 0; -uint8 mem_initialized = 0; - -uint32 _memory_get_total_mem(MultibootInfo* info) -{ - // Grub was nice enough to give us info - if (info->Flags & MultibootInfo_MEMORY) return (1024 + info->MemoryUpper); - - // No? Get info from CMOS - uint8 low, high; - uint32 total; - - low = CmosRead(0x30); - high = CmosRead(0x31); - total = (uint32)(low | high<<8) + 1024; - - ErrorMem("%#Missing memory info from bootloader. Reading from CMOS: %ukb\n", ColorLightRed, total); - - return total; -} - -void _memory_reserve_system(MultibootInfo* info) -{ - MagicBreakpoint(); - if ((info->Flags & MultibootInfo_MEM_MAP) != 0) - { - MultibootMemoryMapEntry* location = (MultibootMemoryMapEntry*)info->MemoryMapAddress; - - while ((uint32)location < (info->MemoryMapAddress + info->MemoryMapLength)) - { - if (location->Type > 1) - MemPhReserveFrames((uint32)location->Address, (uint32)location->Length); - - location = (MultibootMemoryMapEntry*) ((uint32)location + location->Size + sizeof(uint32)); - } - } - - else - { - ErrorMem("%#Missing %#memory map%# info from bootloader.\n", ColorLightRed, ColorWhite, ColorLightRed); - - // Standard memory hole at 15mb - MemPhReserveFrames(0x00F00000, 0x00100000); - } - - // Standard reserved memory areas - MemPhReserveFrames(0x0, 0x400 + 256); // Real mode IVT, BDA - MemPhReserveFrames(0x1000, 0x2400); // DMA buffer - MemPhReserveFrames(0x9FC00, 385*1024); // EBDA, Video memory, ROM area -} - - -void MemoryInitialize (MultibootInfo* info) -{ - uint32 totalSystemMemory = _memory_get_total_mem(info); - - MemPhInitialize(totalSystemMemory); - PagingInitialize(0x200000); - - LogMem("Reserving important areas...\n"); - - _memory_reserve_system(info); - - LogMem("Allocating kernel heap...\n"); - - KernelHeap = MemHeapCreate(KERNEL_HEAP_START, KERNEL_HEAP_START - + KERNEL_HEAP_INITIAL_SIZE, 0xCFFFF000, 3); // is kernel, writeable - - LogMem("Done initializing memory!"); - - mem_initialized = 2; -} - -void MemoryTempInitialize (uint32 kernel_end) -{ - mem_initialized = 1; - mem_kernel_end = kernel_end; - LogMem("Initialized temporary memory manager, allocating from %#0x%x.\n", kernel_end); -} diff --git a/Kernel/library/stdlib/str_ops.c b/Kernel/library/stdlib/str_ops.c index e163210..40c5598 100644 --- a/Kernel/library/stdlib/str_ops.c +++ b/Kernel/library/stdlib/str_ops.c @@ -37,3 +37,20 @@ string strcpy (string s1, const string s2) return s1; } + +char* strchr (string s, int c) +{ + while (*s != '\0' && *s != (char)c) s++; + return ((*s == (char)c) ? (char*)s : NULL); +} + +char* strrchr (string s, int c) +{ + string last = NULL; + + if (c == '\0') return strchr(s, c); + while ((s = strchr(s, c)) != NULL) + last = s; s++; + + return (char*)last; +} diff --git a/Kernel/library/time.c b/Kernel/library/time.c index fa8aa23..91daa8b 100644 --- a/Kernel/library/time.c +++ b/Kernel/library/time.c @@ -6,7 +6,7 @@ extern uint32 _internal_frequency_hz; const int16 MonthLen[] = {0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365 }; -TimeSystem TimeConvertToTimeSystem (Time t) +TimeSystem ConvertTimeToTimeSystem (Time t) { TimeSystem sys = {0,0}; @@ -22,7 +22,7 @@ TimeSystem TimeConvertToTimeSystem (Time t) return sys; } -Time TimeConvertToTime (TimeSystem InternalTime) +Time ConvertTimeSystemToTime (TimeSystem InternalTime) { Time t; t.Milisecond = InternalTime.Time % 1000; diff --git a/Kernel/main.c b/Kernel/main.c index b8c764a..2e69775 100644 --- a/Kernel/main.c +++ b/Kernel/main.c @@ -12,14 +12,16 @@ extern uint32 _end; void k_main(MultibootInfo* info) { uint32 KernelEnd = (uint32)&_end; - MemoryTempInitialize(KernelEnd); ConsoleClear(); + MemoryTempInitialize(KernelEnd); + MemoryInitialize(info); + HalInitialize(); DriversInstall(); // Set up memory manager - MemoryInitialize(info); + Log("All ready. Starting console...\n\n"); diff --git a/build.sh~ b/build-linux.sh similarity index 99% rename from build.sh~ rename to build-linux.sh index 400ef01..84d6b2d 100644 --- a/build.sh~ +++ b/build-linux.sh @@ -68,6 +68,7 @@ cp floppy/original.img luxos.img mkdir /media/floppy1 mount -o loop luxos.img /media/floppy1 cp kernel.bin /media/floppy1/ +sleep 1 umount /media/floppy1 rm -r /media/floppy1 diff --git a/build.sh b/build.sh index 84d6b2d..f86ce26 100644 --- a/build.sh +++ b/build.sh @@ -2,8 +2,9 @@ # ----------------- lux Operating System ----------------- OBJ=build -COMPILER=gcc -LINKER=ld +COMPILER=i586-elf-gcc +LINKER=i586-elf-ld +BUILD_VER="0.1.0" BuildC() { @@ -41,18 +42,20 @@ BuildAsm() return 0 } - -echo "lux operating system v0.1" - -# Clean up -echo "[ 1%] CLEANUP" -rm $OBJ/* 2>/dev/null - # Calculate version number read buildno < ./scripts/version.txt buildno=$(($buildno + 1)) echo $buildno > ./scripts/version.txt -echo "#define OS_BUILD \"0.1.0.$buildno\"" > ./Kernel/include/version.h +echo "#define OS_BUILD \"$BUILD_VER.$buildno\"" > ./Kernel/include/version.h + +# On the screen +echo "========================================================" +echo "LUX Operating System build $BUILD_VER.$buildno" +echo "========================================================" + +# Clean up +echo "[ 1%] CLEANUP" +rm $OBJ/* 2>/dev/null # Build kernel BuildC "filelistC.txt" @@ -64,16 +67,11 @@ $LINKER -T link.ld $OBJ/*.o # Make floppy image echo "[ 97%] WRITING FLOPPY IMAGE..." -cp floppy/original.img luxos.img -mkdir /media/floppy1 -mount -o loop luxos.img /media/floppy1 -cp kernel.bin /media/floppy1/ -sleep 1 -umount /media/floppy1 -rm -r /media/floppy1 +mount A: /mnt/floppy 2>/dev/null >/dev/null +cp kernel.bin /mnt/floppy/ # DONE -echo "[100%] DONE!\n" +echo "[100%] DONE!" exit 0 diff --git a/build/clock.o b/build/clock.o index a85951d..26f98d4 100644 Binary files a/build/clock.o and b/build/clock.o differ diff --git a/build/cmos.o b/build/cmos.o index ff52882..88229fe 100644 Binary files a/build/cmos.o and b/build/cmos.o differ diff --git a/build/console-base.o b/build/console-base.o index c552d92..2323d3d 100644 Binary files a/build/console-base.o and b/build/console-base.o differ diff --git a/build/console-in.o b/build/console-in.o index fb25b7e..0a1d6b0 100644 Binary files a/build/console-in.o and b/build/console-in.o differ diff --git a/build/console-out.o b/build/console-out.o index 777f353..0d859ba 100644 Binary files a/build/console-out.o and b/build/console-out.o differ diff --git a/build/console.o b/build/console.o index 1a17ea0..fabd524 100644 Binary files a/build/console.o and b/build/console.o differ diff --git a/build/convert_ops.o b/build/convert_ops.o index 40a7650..65fc48f 100644 Binary files a/build/convert_ops.o and b/build/convert_ops.o differ diff --git a/build/crash.o b/build/crash.o index 766a54e..0502a21 100644 Binary files a/build/crash.o and b/build/crash.o differ diff --git a/build/ctype.o b/build/ctype.o index a69db89..10a4b4f 100644 Binary files a/build/ctype.o and b/build/ctype.o differ diff --git a/build/dma.o b/build/dma.o index 595a708..1df203a 100644 Binary files a/build/dma.o and b/build/dma.o differ diff --git a/build/drivers.o b/build/drivers.o index 01acae9..287856a 100644 Binary files a/build/drivers.o and b/build/drivers.o differ diff --git a/build/fat12.o b/build/fat12.o new file mode 100644 index 0000000..63d2f64 Binary files /dev/null and b/build/fat12.o differ diff --git a/build/floppy.o b/build/floppy.o index 37cc4d2..9a42009 100644 Binary files a/build/floppy.o and b/build/floppy.o differ diff --git a/build/gdt.o b/build/gdt.o index c1a82da..0bb7bd1 100644 Binary files a/build/gdt.o and b/build/gdt.o differ diff --git a/build/hal.o b/build/hal.o index f0d70f9..4826c3f 100644 Binary files a/build/hal.o and b/build/hal.o differ diff --git a/build/idt.o b/build/idt.o index de6058e..b0f7e7e 100644 Binary files a/build/idt.o and b/build/idt.o differ diff --git a/build/irq-asm.o b/build/irq-asm.o index 7146c0a..9531395 100644 Binary files a/build/irq-asm.o and b/build/irq-asm.o differ diff --git a/build/irq.o b/build/irq.o index 4e1ea31..287d4d5 100644 Binary files a/build/irq.o and b/build/irq.o differ diff --git a/build/isrs-asm.o b/build/isrs-asm.o index 54d7daa..674648d 100644 Binary files a/build/isrs-asm.o and b/build/isrs-asm.o differ diff --git a/build/isrs.o b/build/isrs.o index 6c33f78..32aa453 100644 Binary files a/build/isrs.o and b/build/isrs.o differ diff --git a/build/keyboard.o b/build/keyboard.o index 994a60f..1d40772 100644 Binary files a/build/keyboard.o and b/build/keyboard.o differ diff --git a/build/mem-heap.o b/build/mem-heap.o index 3577932..412ae35 100644 Binary files a/build/mem-heap.o and b/build/mem-heap.o differ diff --git a/build/mem-paging.o b/build/mem-paging.o index 5a20177..7b51f4f 100644 Binary files a/build/mem-paging.o and b/build/mem-paging.o differ diff --git a/build/mem-phys.o b/build/mem-phys.o index da17ca2..a120a3e 100644 Binary files a/build/mem-phys.o and b/build/mem-phys.o differ diff --git a/build/mem_ops.o b/build/mem_ops.o index 5a6a2f5..6a56c0d 100644 Binary files a/build/mem_ops.o and b/build/mem_ops.o differ diff --git a/build/memory_alloc.o b/build/memory_alloc.o index eeccbef..23e4ea4 100644 Binary files a/build/memory_alloc.o and b/build/memory_alloc.o differ diff --git a/build/memory_free.o b/build/memory_free.o index 11f8c7c..52df197 100644 Binary files a/build/memory_free.o and b/build/memory_free.o differ diff --git a/build/memory_info.o b/build/memory_info.o index cd3c9a2..844fad9 100644 Binary files a/build/memory_info.o and b/build/memory_info.o differ diff --git a/build/memory_init.o b/build/memory_init.o index 1036ac1..98d5884 100644 Binary files a/build/memory_init.o and b/build/memory_init.o differ diff --git a/build/mouse.o b/build/mouse.o index 14f5fe2..480d049 100644 Binary files a/build/mouse.o and b/build/mouse.o differ diff --git a/build/num_ops.o b/build/num_ops.o index 83186f9..cf08e7b 100644 Binary files a/build/num_ops.o and b/build/num_ops.o differ diff --git a/build/ord_arr.o b/build/ord_arr.o index 69a37a6..59dad3a 100644 Binary files a/build/ord_arr.o and b/build/ord_arr.o differ diff --git a/build/pic.o b/build/pic.o index 6c12c61..57f15c8 100644 Binary files a/build/pic.o and b/build/pic.o differ diff --git a/build/pit.o b/build/pit.o index 14d683f..d756a04 100644 Binary files a/build/pit.o and b/build/pit.o differ diff --git a/build/reboot.o b/build/reboot.o new file mode 100644 index 0000000..6094f37 Binary files /dev/null and b/build/reboot.o differ diff --git a/build/stdio.o b/build/stdio.o index 6a6ca22..42e6c84 100644 Binary files a/build/stdio.o and b/build/stdio.o differ diff --git a/build/storage.o b/build/storage.o index 0523a7e..c6c6d5b 100644 Binary files a/build/storage.o and b/build/storage.o differ diff --git a/build/str_ops.o b/build/str_ops.o index 5de848b..f10f816 100644 Binary files a/build/str_ops.o and b/build/str_ops.o differ diff --git a/build/sysinfo.o b/build/sysinfo.o deleted file mode 100644 index 77cc6f5..0000000 Binary files a/build/sysinfo.o and /dev/null differ diff --git a/build/time.o b/build/time.o index 460f5d6..2ede248 100644 Binary files a/build/time.o and b/build/time.o differ diff --git a/build/vfs.o b/build/vfs.o new file mode 100644 index 0000000..a56eb05 Binary files /dev/null and b/build/vfs.o differ diff --git a/change.log b/change.log index bf6e22a..cec6f00 100644 --- a/change.log +++ b/change.log @@ -1,5 +1,16 @@ +[GOOD] BUILD 0.1.0.470 DATE 8/30/2011 AT 6:40 PM +==================================================== +Mainly changed: HAL.VFS ++ Designed virtual file system ++ Completed the VFS ++ Added verbose mode for VFS ++ Updated shell script, now shows build number when building +? TODO: Implement one file system (most likely FAT12) +? TODO: Mount floppy device + [GOOD] BUILD 0.1.0.450 DATE 8/29/2011 AT 10:30 AM ==================================================== +Mainly changed: Memory Manager, Library.Memory + Changed 'align 0x4' line above multiboot header in loader.asm to 'align 4' + Removed -e option for echo in build.sh + Modified build.sh for linux @@ -12,6 +23,7 @@ [ BAD] BUILD 0.1.0.390 DATE 8/27/2011 AT 10:54 PM ==================================================== +Mainly changed: Memory Manager, Library + Added stdlib routines, separated in different files + Rewritten physical memory manager + Added virtual mem manager @@ -20,9 +32,7 @@ + Added temporary allocation (at end of kernel), until paging is started - Removed functionality from debug console function 'mem' - Removed system.h, the one remaining function now in stdio.h - -TODO: -Debug initialization -Bug hunt -Implement verbose mode for memmgr -Fix function 'mem' +? TODO: Debug initialization +? TODO: Bug hunt +? TODO: Implement verbose mode for memmgr +? TODO: Fix function 'mem' diff --git a/change.log~ b/change.log~ deleted file mode 100644 index 437ddfb..0000000 --- a/change.log~ +++ /dev/null @@ -1,24 +0,0 @@ -[????] BUILD 0.1.0.??? DATE 8/27/2011 AT ??:?? ?? -==================================================== -+ Changed 'align 0x4' line above multiboot header in loader.asm to 'align 4' -+ Removed -e option for echo in build.sh -+ Modified build.sh for linux -+ Fixed triple fault when enabling paging - - -[ BAD] BUILD 0.1.0.390 DATE 8/27/2011 AT 10:54 PM -==================================================== -+ Added stdlib routines, separated in different files -+ Rewritten physical memory manager -+ Added virtual mem manager -+ Added memory allocation/freeing -+ Added memory library -+ Added temporary allocation (at end of kernel), until paging is started -- Removed functionality from debug console function 'mem' -- Removed system.h, the one remaining function now in stdio.h - -TODO: -Debug initialization -Bug hunt -Implement verbose mode for memmgr -Fix function 'mem' \ No newline at end of file diff --git a/filelistC.txt b/filelistC.txt index 17b6b65..dced3d4 100644 --- a/filelistC.txt +++ b/filelistC.txt @@ -58,8 +58,14 @@ Kernel/hal/keyboard/keyboard.c HAL :: Mouse Kernel/hal/mouse/mouse.c -HAL :: System info and tools -Kernel/hal/sysinfo.c +HAL :: System reboot +Kernel/hal/reboot.c + +HAL :: File systems :: Virtual file system +Kernel/hal/vfs.c + +HAL :: File systems :: FAT12 +Kernel/hal/filesys/fat12.c Libraries :: Character types Kernel/library/ctype.c diff --git a/kernel.bin b/kernel.bin index e26c061..e1a8b4d 100644 Binary files a/kernel.bin and b/kernel.bin differ diff --git a/luxos.img b/luxos.img index 9e49dfd..de2df85 100644 Binary files a/luxos.img and b/luxos.img differ diff --git a/scripts/version.txt b/scripts/version.txt index 29ba0df..5f476b6 100644 --- a/scripts/version.txt +++ b/scripts/version.txt @@ -1 +1 @@ -450 +470