Add: initrd filesystem utilities (ls, cat) + docs

This commit is contained in:
xamidev
2024-09-05 14:59:51 +02:00
parent b59af22897
commit d2034cd68b
10 changed files with 200 additions and 3 deletions

37
src/kernel/initrd.h Normal file
View File

@@ -0,0 +1,37 @@
// Initial TAR ramdisk kernel module header
// Author: xamidev
// Licensed under the Unlicense. See the repo below.
// https://github.com/xamidev/blankos
#ifndef INITRD_H
#define INITRD_H
#define TAR_BLOCK_SIZE 512
#include "system.h"
typedef struct
{
char filename[100];
char mode[8];
char owner[8];
char group[8];
char size[12];
char mtime[12];
char checksum[8];
char typeflag;
char linkname[100];
char magic[6];
char version[2];
char uname[32];
char gname[32];
char devmajor[8];
char devminor[8];
char prefix[155];
} tar_header_t;
void tar_find_file(uint8_t *tar_start, const char* filename);
void ls_initrd(uint8_t* initrd);
void cat_initrd(uint8_t* initrd, const char* filename);
#endif