550W Document
550W, a high-end OS
|
#include <common/types.h>
类 | |
struct | super_block |
struct | dir_entry |
struct | fentry |
struct | dirent64 |
struct | kstat |
宏定义 | |
#define | DIR 0x040000 |
#define | FILE 0x100000 |
#define | SEEK_SET 0 |
#define | SEEK_CUR 1 |
#define | SEEK_END 2 |
#define | STDIN 0 |
#define | STDOUT 1 |
#define | STDERR 2 |
#define | STDMAX 3 |
#define | stdin STDIN |
#define | stdout STDOUT |
#define | stderr STDERR |
类型定义 | |
typedef struct super_block | super_block_t |
typedef struct dir_entry | dir_entry_t |
typedef struct fentry | fentry_t |
typedef struct dirent64 | dirent64_t |
typedef struct kstat | kstat_t |
函数 | |
int | fs_load_file (const char *name, uint8_t **bin, int *len) |
load elf file in root dir, 0 success, -1 fail 更多... | |
bool | fs_check_file_existence (const char *name) |
int | fs_init () |
long | sys_getcwd (char *buf, size_t size) |
int | sys_pipe2 (int *fd, mode_t flags) |
allocate pipe to fd[2]. 更多... | |
int | sys_dup (int old) |
copy a fd and return the new one 更多... | |
int | sys_dup3 (int old, int new, mode_t flags) |
copy a fd and return the new one 更多... | |
int | sys_mkdirat (int dirfd, const char *path, mode_t mode) |
mk dir at patch, success 0 fail -1 更多... | |
int | sys_chdir (char *path) |
change dir by patch, fail return -1 更多... | |
int | sys_getdents64 (int fd, dirent64_t *dirent, size_t len) |
int | sys_openat (int dirfd, const char *filename, mode_t flags, mode_t mode) |
open a file with path/cwd+path/dirfd+path 更多... | |
int | sys_close (int fd) |
int | sys_linkat (int old, const char *oldname, int newd, const char *newname, mode_t flags) |
int | sys_unlinkat (int dirfd, const char *path, mode_t flags) |
rm file directed by path, 0 success -1 fail 更多... | |
int | sys_mount (const char *special, const char *dir, const char *type, mode_t flags, void *data) |
int | sys_umount2 (const char *special, mode_t flags) |
ssize_t | sys_read (int fd, char *buf, size_t count) |
read count bytes to buf of fd file 更多... | |
ssize_t | sys_write (int fd, const char *buf, size_t count) |
int | sys_fstat (int fd, kstat_t *statbuf) |
void * | sys_mmap (void *addr, size_t length, int prot, int flags, int fd, off_t offset) |
int | sys_munmap (void *addr, size_t length) |
变量 | |
int | fs_start_sec |
int | magic_number |
int | sb_sec_offset |
int | sb2_sec_offset |
uint64_t | iab_map_addr_offset |
uint64_t | sec_map_addr_offset |
uint64_t | iab_map_addr_size |
uint64_t | inode_addr_offset |
uint64_t | dir_addr_offset |
uint64_t | dir2_addr_offset |
uint64_t | dir3_addr_offset |
uint64_t | dir4_addr_offset |
uint64_t | data_addr_offset |
uint64_t | empty_block |
#define DIR 0x040000 |
#define FILE 0x100000 |
#define SEEK_CUR 1 |
#define SEEK_END 2 |
#define SEEK_SET 0 |
#define STDERR 2 |
#define stderr STDERR |
#define STDIN 0 |
#define stdin STDIN |
#define STDMAX 3 |
#define STDOUT 1 |
#define stdout STDOUT |
typedef struct dir_entry dir_entry_t |
typedef struct dirent64 dirent64_t |
typedef struct super_block super_block_t |
bool fs_check_file_existence | ( | const char * | name | ) |
int fs_init | ( | ) |
int fs_load_file | ( | const char * | name, |
uint8_t ** | bin, | ||
int * | len | ||
) |
load elf file in root dir, 0 success, -1 fail
name | elf file should be loaded |
int sys_chdir | ( | char * | path | ) |
change dir by patch, fail return -1
path | buffer for dir path |
int sys_close | ( | int | fd | ) |
int sys_dup | ( | int | old | ) |
copy a fd and return the new one
old | old fd |
int sys_dup3 | ( | int | old, |
int | new, | ||
mode_t | flags | ||
) |
copy a fd and return the new one
old | old fd |
new | new fd |
int sys_fstat | ( | int | fd, |
kstat_t * | statbuf | ||
) |
long sys_getcwd | ( | char * | buf, |
size_t | size | ||
) |
buf | buffer for cur_dir path |
size | bytes of buf |
int sys_getdents64 | ( | int | fd, |
dirent64_t * | dirent, | ||
size_t | len | ||
) |
int sys_linkat | ( | int | old, |
const char * | oldname, | ||
int | newd, | ||
const char * | newname, | ||
mode_t | flags | ||
) |
int sys_mkdirat | ( | int | dirfd, |
const char * | path_0, | ||
mode_t | mode | ||
) |
mk dir at patch, success 0 fail -1
dir_fd | mkdir at this dir |
flag | AT_FDCWD means mkdir at cwd |
path | path if from '/', other just means dir name |
int sys_mount | ( | const char * | special, |
const char * | dir, | ||
const char * | type, | ||
mode_t | flags, | ||
void * | data | ||
) |
int sys_munmap | ( | void * | addr, |
size_t | length | ||
) |
open a file with path/cwd+path/dirfd+path
fd | file descripter |
buf | bytes buf |
count | read len |
int sys_pipe2 | ( | int * | fd, |
mode_t | flags | ||
) |
allocate pipe to fd[2].
fd | target fd array. |
-1 | failed 0: succeed |
read count bytes to buf of fd file
fd | file descripter |
buf | bytes buf |
count | read len |
int sys_umount2 | ( | const char * | special, |
mode_t | flags | ||
) |
int sys_unlinkat | ( | int | dirfd, |
const char * | path_0, | ||
mode_t | flags | ||
) |
rm file directed by path, 0 success -1 fail
dirfd | file descripter |
path | dile path |
count | 0 or AT_REMOVEDIR |
|
extern |
|
extern |
|
extern |
|
extern |
|
extern |
|
extern |
|
extern |
|
extern |
|
extern |
|
extern |
|
extern |
|
extern |
|
extern |
|
extern |