-
Notifications
You must be signed in to change notification settings - Fork 3
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
Does string comparing / pointer comparing / memory comparing
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);
This file is included by almost everything, it contains some of the 'core' of what you need.
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;
#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
void die();
void ThrowISR(int n);
This file contains the drivers for the keyboard and also the port in and out commands
// 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();
A WIP mallc and memory management lib
void memcpy(void *dest, void *src, size_t n);
int Getmemory();
A really early implementation of the std::string lib.
class String
A really early implementation of the std::Vector lib.
class Vector
The main c++ VGA Driver
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);
The VirtualConsole handler
class VirtualConsole
__ THIS LICENSE APPLIES TO ALL FILES AND FOLDERS IN THIS PROJECT. __
__ IF YOU CONTRIBUTE, YOUR NAME WILL BE ADDED TO THIS FILE. __
__ MIT License __
Copyright (c) 2021 Main Menu aka Corigan01
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.