...
This commit is contained in:
3
.clangd
3
.clangd
@@ -13,3 +13,6 @@ CompileFlags:
|
||||
- "-nostdlib"
|
||||
- "-I"
|
||||
- "/home/oliste/repos/nub-os/src/stdlib"
|
||||
|
||||
Style:
|
||||
AngledHeaders: "src/stdlib/.*"
|
||||
|
||||
@@ -1,17 +1,18 @@
|
||||
#pragma once
|
||||
|
||||
#include "stdint.h"
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
|
||||
typedef struct
|
||||
{
|
||||
uint64_t base_address;
|
||||
uint64_t length;
|
||||
size_t length;
|
||||
} memory_region_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
uint64_t num_regions;
|
||||
memory_region_t* regions;
|
||||
size_t num_regions;
|
||||
} memory_map_t;
|
||||
|
||||
extern memory_map_t memory_map;
|
||||
@@ -1,7 +1,7 @@
|
||||
#include "interrupts.h"
|
||||
#include "../arch.h"
|
||||
#include "stdio.h"
|
||||
#include "util.h"
|
||||
#include <stdio.h>
|
||||
|
||||
#define PIC1_COMMAND 0x20
|
||||
#define PIC1_DATA 0x21
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
#include "stdbool.h"
|
||||
#include "stdint.h"
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
|
||||
typedef struct
|
||||
{
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// #include "keyboard.h"
|
||||
// #include "interrupts.h"
|
||||
// #include "util.h"
|
||||
// #include "stddef.h"
|
||||
// #include <stddef.h>
|
||||
|
||||
// #define SCANCODE_LEFT_SHIFT 42
|
||||
// #define SCANCODE_RIGHT_SHIFT 54
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// #pragma once
|
||||
|
||||
// #include "stdbool.h"
|
||||
// #include "stdint.h"
|
||||
// #include <stdbool.h>
|
||||
// #include <stdint.h>
|
||||
|
||||
// typedef struct
|
||||
// {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#include "mmap.h"
|
||||
#include "../mmap.h"
|
||||
#include "stddef.h"
|
||||
#include "stdio.h"
|
||||
#include <stddef.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#define USABLE_REGION_SIZE 32
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#pragma once
|
||||
|
||||
#include "stdint.h"
|
||||
#include <stdint.h>
|
||||
|
||||
enum
|
||||
{
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#include "vga.h"
|
||||
#include "stddef.h"
|
||||
#include <stddef.h>
|
||||
|
||||
#define ROWS 25
|
||||
#define COLUMNS 80
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#pragma once
|
||||
|
||||
#include "stdint.h"
|
||||
#include <stdint.h>
|
||||
|
||||
#define VGA_BLACK 0
|
||||
#define VGA_BLUE 1
|
||||
|
||||
@@ -3,10 +3,9 @@
|
||||
#include "interrupts.h"
|
||||
#include "mmap.h"
|
||||
#include "multiboot.h"
|
||||
#include "stddef.h"
|
||||
#include "stdio.h"
|
||||
#include "util.h"
|
||||
#include "vga.h"
|
||||
#include <stdio.h>
|
||||
|
||||
void entry(multiboot_info_t* mbd)
|
||||
{
|
||||
@@ -14,7 +13,7 @@ void entry(multiboot_info_t* mbd)
|
||||
map_memory(mbd);
|
||||
remap_pic();
|
||||
enable_interrupts();
|
||||
kmain();
|
||||
main();
|
||||
}
|
||||
|
||||
void arch_callback()
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
#include "kernel.h"
|
||||
#include "pmm.h"
|
||||
#include "stdio.h"
|
||||
#include <stdio.h>
|
||||
|
||||
void kmain()
|
||||
void main()
|
||||
{
|
||||
init_pmm();
|
||||
printf("Welcome to nub OS :)\n");
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
#pragma once
|
||||
|
||||
void kmain();
|
||||
void main();
|
||||
@@ -1,8 +1,8 @@
|
||||
#include "pmm.h"
|
||||
#include "arch/mmap.h"
|
||||
#include "mem.h"
|
||||
#include "stddef.h"
|
||||
#include "stdio.h"
|
||||
#include <stddef.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#define BITMAP_SIZE 32768 // Supports up to 1GB of RAM
|
||||
#define USABLE_REGION_SIZE 32
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#pragma once
|
||||
|
||||
#include "stdint.h"
|
||||
#include <stdint.h>
|
||||
|
||||
#define PAGE_SIZE 4096
|
||||
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
#include "mem.h"
|
||||
#include "stdint.h"
|
||||
|
||||
void memset(void* destination, uint8_t value, size_t length)
|
||||
{
|
||||
for (size_t i = 0; i < length; i++)
|
||||
{
|
||||
((uint8_t*)destination)[i] = value;
|
||||
}
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
#include "stddef.h"
|
||||
#include "stdint.h"
|
||||
|
||||
void memset(void* destination, uint8_t value, size_t length);
|
||||
@@ -1,9 +1,9 @@
|
||||
#include "stdio.h"
|
||||
#include "../arch/arch.h"
|
||||
#include "stdarg.h"
|
||||
#include "stdbool.h"
|
||||
#include "stddef.h"
|
||||
#include "string.h"
|
||||
#include <stdarg.h>
|
||||
#include <stdbool.h>
|
||||
#include <stddef.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
void printf(const char* fmt, ...)
|
||||
{
|
||||
|
||||
@@ -1,4 +1,12 @@
|
||||
#include "string.h"
|
||||
#include <string.h>
|
||||
|
||||
void memset(void* destination, uint8_t value, size_t length)
|
||||
{
|
||||
for (size_t i = 0; i < length; i++)
|
||||
{
|
||||
((uint8_t*)destination)[i] = value;
|
||||
}
|
||||
}
|
||||
|
||||
int strcmp(const char* a, const char* b)
|
||||
{
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
#pragma once
|
||||
|
||||
#include "stddef.h"
|
||||
#include "stdint.h"
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
|
||||
void memset(void* destination, uint8_t value, size_t length);
|
||||
int strcmp(const char* a, const char* b);
|
||||
void reverse(char* str, size_t length);
|
||||
void uitoa64(uint64_t value, char* buffer);
|
||||
|
||||
Reference in New Issue
Block a user