Lib - corigan01/FluxedOS GitHub Wiki
Lib
This file contains all the tools or drivers needed for building this OS.
File structure :
├── compare
│ ├── compare.cpp
│ └── compare.h
├── core
│ ├── core.c
│ └── core.h
├── IO
│ ├── keyboard.cpp
│ ├── Keyboard.h
│ ├── port.cpp
│ └── port.h
├── mem
│ ├── mem.cpp
│ └── mem.h
├── String
│ ├── String.cpp
│ └── String.h
├── Term
│ ├── Term.c
│ └── Term.h
├── Vector
│ ├── vector.cpp
│ └── vector.h
├── VGA
│ ├── VGA.cpp
│ └── VGA.h
└── VirtualConsole
├── VirtualConsole.cpp
└── VirtualConsole.h
Compare
Does string comparing / pointer comparing / memory comparing
Functions
int strcmp(const char *s1, const char *s2) ;
int strncmp(const char *s1, const char *s2, size_t n);
int memcmp(const void *b1, const void *b2, size_t n);
core
This file is included by almost everything, it contains some of the 'core' of what you need.
Types
typedef unsigned char uint8_t;
typedef unsigned short uint16_t;
typedef unsigned int uint32_t;
typedef uint16_t size_t;
typedef unsigned char uint8;
typedef unsigned short uint16;
typedef unsigned int uint32;
Defines
#define NULL (char)0x00
#define KERNAL_NEEDED (int)0x00// That file is required for boot
#define KERNAL_OPTION (int)0x80// This file will not be required for boot
#define KERNAL_BACKUP (int)0xff// This will not be automaticly loaded, only loaded if a system error is detected
Functions
void die();
void ThrowISR(int n);
IO
This file contains the drivers for the keyboard and also the port in and out commands
Functions
// PORT.h
unsigned char port_byte_in (unsigned short port);
void port_byte_out (unsigned short port, unsigned char data);
uint16_t port_word_in (uint16_t port);
void port_word_out (unsigned short port, unsigned short data);
void port_long_out(uint32_t port, uint32_t value);
uint32_t port_long_in(uint32_t port);
// Keyboard.h
char get_input_keycode();
char get_ascii_char(uint8 key_code);
char getKeydown();
char getKeyCodedown();
mem
A WIP mallc and memory management lib
Functions
void memcpy(void *dest, void *src, size_t n);
int Getmemory();
String
A really early implementation of the std::string lib.
Classes
class String
Vector
A really early implementation of the std::Vector lib.
Classes
class Vector
VGA
The main c++ VGA Driver
Functions
void INIT_DISPLAY();
void SET_DISPLAY_MODE(MODES::__VGA__MODES mode);
void SET_MODS(MODS::__VGA__MOD modID, int mod);
void CLEAR_DISPLAY();
void RESET();
uint16 VGA_ENTRY(char ch, uint8 fore_color, uint8 back_color);
void PRINT_CHAR(char ch);
void PRINT_STR(const char * str);
void SET_COLOR(uint8 fore_color, uint8 back_color);
void kprintf(const char* format, ...);
void PRINT_INT(int in);
VC
The VirtualConsole handler
Classes
class VirtualConsole