sys: add userspace bootstrap program
This commit is contained in:
45
sys/bootstrap/tar.h
Normal file
45
sys/bootstrap/tar.h
Normal file
@@ -0,0 +1,45 @@
|
||||
#ifndef TAR_H_
|
||||
#define TAR_H_
|
||||
|
||||
#include <mango/types.h>
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
|
||||
struct tar {
|
||||
struct tar_bin_header *tar_entries;
|
||||
};
|
||||
|
||||
struct tar_bin_header {
|
||||
char filename[100];
|
||||
char mode[8];
|
||||
char uid[8];
|
||||
char gid[8];
|
||||
char size[12];
|
||||
char mtime[12];
|
||||
char chksum[8];
|
||||
char typeflag[1];
|
||||
} __attribute__((aligned(512)));
|
||||
|
||||
struct tar_header {
|
||||
char filename[100];
|
||||
size_t size;
|
||||
};
|
||||
|
||||
struct tar_file {
|
||||
struct tar_header f_header;
|
||||
const void *f_data;
|
||||
};
|
||||
|
||||
extern int tar_init(struct tar *tar, uintptr_t base);
|
||||
|
||||
extern int tar_open(struct tar *tar, const char *path, struct tar_file *out);
|
||||
|
||||
extern int tar_file_create_vm_object(
|
||||
const struct tar_file *file,
|
||||
kern_handle_t *out);
|
||||
|
||||
extern int tar_header_decode(
|
||||
const struct tar_bin_header *in,
|
||||
struct tar_header *out);
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user