This repository has been archived by the owner on May 12, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
068cce1
commit b2425ca
Showing
13 changed files
with
208 additions
and
118 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
Hello, Paradox! | ||
Welcome to Paradox! | ||
To edit this message edit /etc/motd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#ifndef __STDLIB_H__ | ||
#define __STDLIB_H__ | ||
|
||
#include <system/memory/heap.h> | ||
#include <system/memory/pmm.h> | ||
|
||
#endif // __STDLIB_H__ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
#include "ramdisk.h" | ||
#include <kernel/boot.h> | ||
#include <printf.h> | ||
|
||
#define RD_MODULE_NAME mod_request.response->modules[0] | ||
|
||
ramdisk_t *init_rd(void) { | ||
ramdisk_t *rd = (ramdisk_t *)malloc(sizeof(ramdisk_t)); | ||
if (rd == NULL) { | ||
dprintf("[Ramdisk] Failed to allocate memory for ramdisk_t"); | ||
return NULL; | ||
} | ||
|
||
struct limine_file *temp_file; | ||
temp_file = RD_MODULE_NAME; | ||
|
||
struct Tar *tar = (struct Tar *)malloc(sizeof(struct Tar)); | ||
if (tar == NULL) { | ||
dprintf("[Ramdisk] Failed to allocate memory for Tar"); | ||
free(rd); | ||
return NULL; | ||
} | ||
|
||
extractTarData((char *)(temp_file->address), (char *)(temp_file->size), tar); | ||
|
||
rd->content = tar; // Assign dynamically allocated tar to rd->content | ||
|
||
if (rd->content == NULL) { | ||
free(rd); // Free rd if content is NULL | ||
return NULL; | ||
} | ||
|
||
rd->location = (uint64_t)rd; | ||
rd->size = temp_file->size; | ||
rd->files = rd->content->fileCount; | ||
rd->actual_size = sizeof(ramdisk_t); | ||
|
||
dprintf("[Ramdisk] Ramdisk located at 0x%016llX is now initialized!\n", | ||
rd->location); | ||
|
||
return rd; | ||
} | ||
|
||
struct File *rd_get_file(ramdisk_t *rd, const char *filename) { | ||
if (rd == NULL || rd->content == NULL || filename == NULL) { | ||
return NULL; | ||
} | ||
|
||
for (unsigned int i = 0; i < rd->content->fileCount; ++i) { | ||
if (strcmp(rd->content->files[i].name, filename) == 0) { | ||
return &(rd->content->files[i]); | ||
} | ||
} | ||
|
||
return NULL; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#ifndef __RAMDISK_H__ | ||
#define __RAMDISK_H__ | ||
|
||
#include <filesystem/tar.h> | ||
|
||
#include <stdint.h> | ||
#include <stdlib.h> | ||
#include <strings.h> | ||
|
||
typedef struct { | ||
struct Tar *content; | ||
uint64_t location; | ||
uint32_t size; | ||
uint16_t files; | ||
uint32_t actual_size; | ||
} ramdisk_t; | ||
|
||
ramdisk_t *init_rd(void); | ||
struct File *rd_get_file(ramdisk_t *rd, const char *filename); | ||
|
||
#endif // __RAMDISK_H__ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule nighterm
updated
from 186701 to 8f4db8
Oops, something went wrong.