Contains types(u8, u16, u32, u64, s8, s16, s32, s64, bool)
memcpy(u8 *src, u8 *dest, u32 bytes)
- copies u8 data from one memory location to another
Basic open source zlib library written by Apple inc.
Basic string library realized by me specially for madeinhellOS
string_init_char_size(struct string* s, char* data, unsigned int size)
- initializes string with char* data and sizestring_init_char(struct string* s, char* data)
- initializes string with char* data(it must contain \0 at the end of the string)string_init(struct string* s)
- initializes string with empty datastring_print(struct string s)
- prints stringstring_println(struct string s)
- prints string with newlinestring_append_char(struct string* s, char data)
- appends char to stringstring_append_chardata(struct string* s, char* data, unsigned int size)
- appends char* data to stringstring_append_string(struct string* s, struct string s2)
- appends string to stringstring_at(struct string s, unsigned int index)
- returns char at indexstring_at_string(struct string s, unsigned int index, unsigned int size)
- returns string at index(like a substring)string_length(struct string s)
- returns string length(it must contain \0 at the end of the string)string_length_char(char* data)
- returns string length(it must contain \0 at the end of the string)string_copy(struct string s1, struct string* s2)
- copies string s1 to string s2string_delete(struct string* xs)
- deletes string(deallocate memory from data, and set data, size, capacity to NULL)string_substr(s, start, size)
- returns string from start to start+sizestring_substr1(s, start, end)
- returns string from start to end
Contains file creation, file opening, file reading, file writing, file closing, and file deleting functions in file.h also contains assembler realizations for it
fopen(char* filename)
- opens filefwrite(int descriptor, char* data, size_t size)
- writes data to filefread(int descriptor, char* buffer, size_t size)
- reads data from filefclose(int descriptor)
- closes fileCreateFile(file* f)
- creates fileCreateFile1(file* f)
- creates file(without deleting old file if exists)mkdir(char* folder)
- creates folderrmdir(char* folder)
- deletes folderSetCurFolder(char* folder)
- sets current folderGetCurFolder(char* folder)
- gets current folderfile
- type using to work with files
get_memory_size()
- returns total memory size in KiBstruct ptr
- default type(for madeinhellOS) for memory allocation(contains pointer to start of allocated memory and size of allocated memory in bytes)malloc(unsigned long long size)
- allocates memory and returns struct ptrfree(struct ptr* ptr)
- deallocates memoryrealloc(struct ptr* ptr, unsigned long long size)
- reallocates memory Please note that size of allocated memory is always multiple of default_memory_block_size(4096 bytes now)
port_byte_in(unsigned short port)
- reads byte from portport_byte_out(unsigned short port, unsigned char data)
- writes byte to portport_word_in(unsigned short port)
- reads word(2 bytes) from portport_word_out(unsigned short port, unsigned short data)
- writes word(2 bytes) to port
kprint(u8 *str)
- prints string to screen(string must contain \0 at the end of the string)putchar(u8 character, u8 attribute_byte)
- prints character to screenclear_screen()
- clears screenwrite(u8 character, u8 attribute_byte, u16 offset)
- prints character to screen with vga offsetscroll_line()
- scrolls screen lineget_cursor()
- returns cursor positionset_cursor(u16 pos)
- sets cursor position
get_key()
- returns scancode of pressed key Also it contains all scancodes of keyboard in format KR_ for released keys and KP_ for pressed keys Example:KR_RIGHT_CTRL
for released right control key andKP_RIGHT_CTRL
for pressed right control key
input()
- returns string with pressed keys(befor enter without\n
)