Skip to content

Commit

Permalink
flanterm in progress
Browse files Browse the repository at this point in the history
  • Loading branch information
PratyushKing committed Jun 3, 2024
1 parent be2b1b7 commit 94de5e2
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 9 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ limine_building/bin/*
limine_building/iso/*
bin/
.vscode/*
flanterm_build/
flanterm_build
flanterm_build/*
13 changes: 9 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
COMPILER=g++
CPPC=g++
CC=gcc
LINKER=gcc
COMPILER_FLAGS=\
-Wall \
Expand All @@ -16,7 +17,7 @@ COMPILER_FLAGS=\
-mno-sse2 \
-mno-red-zone \
-O2
LINKER_FLAGS=-ffreestanding -O2 -nostdlib bin/kernel.o
LINKER_FLAGS=-ffreestanding -O2 -nostdlib bin/flanterm.o bin/kernel.o
BIN_LOCATION=bin/AntiniOS.bin

all: prepare kernel linker prepare-limine
Expand All @@ -27,8 +28,10 @@ prepare: prepare-libs
prepare-libs: prepare-flanterm

prepare-flanterm:
@mkdir -p flanterm_build/
@mkdir -p src/flanterm/backends
@git clone https://github.com/mintsuki/flanterm flanterm_build/ --depth=1
@cp -r flanterm_build/flanterm.c flanterm_build/flanterm.h src/flanterm/
@cp -r flanterm_build/backends/fb.c flanterm_build/backends/fb.h src/flanterm/backends

clean: clean_bin clean_limine
distclean: clean_bin clean_limine clean_flanterm
Expand All @@ -41,9 +44,11 @@ clean_limine:

clean_flanterm:
@rm -fr flanterm_build/
@rm -fr src/flanterm/

kernel:
@$(COMPILER) -c -x c flanterm_build/flanterm.c -x "c++" src/kernel.cpp -o bin/kernel.o $(COMPILER_FLAGS)
@$(CPPC) -c -x c -x "c++" src/kernel.cpp -o bin/kernel.o $(COMPILER_FLAGS)
@$(CC) -c src/flanterm/flanterm.c -o bin/flanterm.o $(COMPILER_FLAGS)

linker:
@$(LINKER) -T src/linker.ld -o bin/AntiniOS.bin $(LINKER_FLAGS)
Expand Down
1 change: 0 additions & 1 deletion flanterm_build
Submodule flanterm_build deleted from 88740e
2 changes: 1 addition & 1 deletion src/include/libcpp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ void int_to_string(int value, char* buffer, uint32_t buffer_size)

char* ret_int_to_string(int value)
{
char* buffer;
char* buffer = "";
if (value < 0) {
value = -value;
uint_to_string((uint32_t)value, buffer + 1, strlen(buffer) - 1);
Expand Down
4 changes: 2 additions & 2 deletions src/kernel.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include "include/libcpp.cpp"
#include "include/limine.hpp"
#include "flanterm.h"
#include "fb.h"
#include "flanterm/flanterm.h"
#include "flanterm/backends/fb.h"

#include <stdint.h>
#include <stdbool.h>
Expand Down

0 comments on commit 94de5e2

Please sign in to comment.