Skip to content

Commit

Permalink
merge fix
Browse files Browse the repository at this point in the history
  • Loading branch information
joexbayer committed Jan 10, 2024
2 parents bd7ae28 + 26e4e17 commit 692c19d
Show file tree
Hide file tree
Showing 149 changed files with 2,254 additions and 2,802 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/pipeline.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Build & Tests

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y build-essential gcc-multilib
- name: Compile
run: make compile

- name: Apps
run: make apps

- name: Tests
run: make tests
9 changes: 4 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ ASFLAGS=
LDFLAGS=
MAKEFLAGS += --no-print-directory

QEMU_OPS = -device e1000,netdev=net0 -serial stdio -netdev user,id=net0,hostfwd=tcp::8080-:8080 -object filter-dump,id=net0,netdev=net0,file=dump.dat -m 32m
QEMU_OPS = -device virtio-net-pci,netdev=net0 -serial stdio -netdev user,id=net0,hostfwd=tcp::8080-:8080 -object filter-dump,id=net0,netdev=net0,file=dump.dat -m 32m

# ---------------- For counting how many files to compile ----------------
ifneq ($(words $(MAKECMDGOALS)),1)
Expand Down Expand Up @@ -49,19 +49,18 @@ else
LD=i386-elf-ld
endif


# ---------------- Objects to compile ----------------
PROGRAMOBJ = bin/shell.o bin/networking.o bin/dhcpd.o bin/tcpd.o bin/logd.o bin/taskbar.o bin/about.o

GFXOBJ = bin/window.o bin/component.o bin/composition.o bin/gfxlib.o bin/api.o bin/theme.o bin/core.o

KERNELOBJ = bin/kernel.o bin/terminal.o bin/helpers.o bin/pci.o bin/virtualdisk.o bin/windowmanager.o bin/icons.o bin/vga.o \
bin/util.o bin/interrupts.o bin/irs_entry.o bin/timer.o bin/gdt.o bin/interpreter.o bin/vm.o bin/lex.o bin/smp.o \
bin/libc.o bin/interrupts.o bin/irs_entry.o bin/timer.o bin/gdt.o bin/interpreter.o bin/vm.o bin/lex.o bin/smp.o \
bin/keyboard.o bin/pcb.o bin/pcb_queue.o bin/memory.o bin/vmem.o bin/kmem.o bin/e1000.o bin/display.o bin/env.o bin/conf.o \
bin/sync.o bin/kthreads.o bin/ata.o bin/bitmap.o bin/rtc.o bin/tss.o bin/kutils.o bin/script.o bin/login.o bin/cmds.o \
bin/sync.o bin/kthreads.o bin/ata.o bin/bitmap.o bin/rtc.o bin/tss.o bin/kutils.o bin/login.o bin/cmds.o \
bin/diskdev.o bin/scheduler.o bin/work.o bin/rbuffer.o bin/errors.o bin/kclock.o bin/tar.o bin/color.o bin/loopback.o \
bin/serial.o bin/io.o bin/syscalls.o bin/list.o bin/hashmap.o bin/vbe.o bin/ksyms.o bin/windowserver.o bin/encoding.o\
bin/mouse.o bin/ipc.o bin/sysinf.o ${PROGRAMOBJ} ${GFXOBJ} bin/font8.o bin/net.o bin/fs.o bin/ext.o bin/fat16.o bin/partition.o bin/snake.o
bin/mouse.o bin/ipc.o bin/sysinf.o ${PROGRAMOBJ} ${GFXOBJ} bin/font8.o bin/net.o bin/fs.o bin/ext.o bin/fat16.o bin/partition.o bin/snake.o bin/msgbox.o

BOOTOBJ = bin/bootloader.o

Expand Down
30 changes: 10 additions & 20 deletions apps/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,11 @@ UTILS = bin/cppUtils.o bin/crt0.o

USROBJS =

COMMON = ../bin/syscall.o ../bin/util.o ../bin/printf.o ../bin/graphics.o ../bin/netlib.o bin/cppUtils.o
LIB_COMMON_OBJS = ../bin/syscall.o ../bin/util.o ../bin/printf.o bin/cppUtils.o
LIB_GRAPHICS_OBJS = ../bin/graphics.o ../bin/util.o
COMMON = ../bin/syscall.o ../bin/libc.o ../bin/printf.o ../bin/graphics.o ../bin/netlib.o bin/cppUtils.o
LIB_COMMON_OBJS = ../bin/syscall.o ../bin/libc.o ../bin/printf.o bin/cppUtils.o
LIB_GRAPHICS_OBJS = ../bin/graphics.o ../bin/libc.o
LIB_NET_OBJS = ../bin/netlib.o


.PHONY: all new programs
all: new

Expand All @@ -59,18 +58,6 @@ programs: staticlibs bin/crt0.o ${USROBJS}
@make -C cube/
@echo [USR] All user programs created and linked!

# bin/%.o: %.c bin/crt0.o
# @$(CC) -o $@ -c $< $(CCFLAGS)
# @$(LD) -o $(basename $@) $@ -L. -l:lib.a $(LDFLAGS) -T ./utils/linker.ld
# @cp $(basename $@) ../rootfs/bin/
# @echo [USR] Compiling $(basename $@)

# bin/%.o: %.cpp bin/crt0.o
# @$(CPP) -o $@ -c $< $(CCFLAGS) -fno-exceptions -fno-rtti
# @$(LD) -o $(basename $@) $@ $(LDFLAGS) -L. -l:lib.a -T ./utils/linker.ld
# @cp $(basename $@) ../rootfs/bin/
# @echo [USR] Compiling $(basename $@)

bin/%.o: utils/%.cpp
@$(CPP) -o $@ -c $< $(CCFLAGS) -fno-exceptions -fno-rtti -I ./../include/
@echo [USR] Compiling C++ $(basename $@)
Expand All @@ -89,8 +76,11 @@ bindir:

clean:
rm -f ./bin/*
make -C editor/ clean
make -C colors/ clean
make -C finder/ clean
make -C calculator/ clean
@make -C editor/ clean
@make -C wolfstein/ clean
@make -C colors/ clean
@make -C finder/ clean
@make -C calculator/ clean
@make -C graphs/ clean
@make -C cube/ clean
rm -f .depend
13 changes: 12 additions & 1 deletion apps/calculator/calc.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,15 @@
#include <util.h>
/**
* @file calc.cpp
* @author Joe Bayer (joexbayer)
* @brief A simple calculator app
* @version 0.1
* @date 2024-01-10
*
* @copyright Copyright (c) 2024
*
*/

#include <libc.h>
#include <utils/Graphics.hpp>
#include <utils/MsgBox.hpp>
#include <gfx/events.h>
Expand Down
2 changes: 1 addition & 1 deletion apps/clock.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#include <gfx/events.h>
#include <colors.h>
#include <rtc.h>
#include <util.h>
#include <libc.h>
#include <syscall_helper.h>

#define center_x(size) ((110/2) - ((size*8)/2))
Expand Down
11 changes: 11 additions & 0 deletions apps/colors/colors.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
/**
* @file colors.cpp
* @author Joe Bayer (joexbayer)
* @brief A simple color picker app
* @version 0.1
* @date 2024-01-10
*
* @copyright Copyright (c) 2024
*
*/

#include <lib/printf.h>
#include <utils/Graphics.hpp>
#include <gfx/events.h>
Expand Down
13 changes: 12 additions & 1 deletion apps/cube/cube.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
/**
* @file cube.cpp
* @author Joe Bayer (joexbayer)
* @brief A simple cube demo
* @version 0.1
* @date 2024-01-10
*
* @copyright Copyright (c) 2024
*
*/

#include <utils/Graphics.hpp>
#include <util.h>
#include <libc.h>
#include <colors.h>

extern float sin_60[60];
Expand Down
3 changes: 1 addition & 2 deletions apps/echo.cpp
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
#include <lib/graphics.h>
#include <util.h>
#include <libc.h>
#include <colors.h>
#include <lib/net.h>
#include "../apps/utils/cppUtils.hpp"


class TcpEcho : public Window {
public:
TcpEcho(int width, int height) : Window(200, 200, "Echo", 0) {
Expand Down
11 changes: 11 additions & 0 deletions apps/editor/edit.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
/**
* @file edit.cpp
* @author Joe Bayer (joexbayer)
* @brief A text editor app
* @version 0.1
* @date 2024-01-10
*
* @copyright Copyright (c) 2024
*
*/

#include "edit.hpp"
#include <utils/cppUtils.hpp>
#include <utils/Graphics.hpp>
Expand Down
2 changes: 1 addition & 1 deletion apps/editor/edit.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#include <lib/printf.h>
#include <utils/Graphics.hpp>
#include <gfx/events.h>
#include <util.h>
#include <libc.h>
#include <colors.h>
#include <fs/ext.h>
#include <fs/fs.h>
Expand Down
13 changes: 12 additions & 1 deletion apps/finder/finder.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,15 @@
#include <util.h>
/**
* @file finder.cpp
* @author Joe Bayer (joexbayer)
* @brief A file manager app
* @version 0.1
* @date 2024-01-10
*
* @copyright Copyright (c) 2024
*
*/

#include <libc.h>
#include <utils/Graphics.hpp>
#include <gfx/events.h>
#include <colors.h>
Expand Down
13 changes: 12 additions & 1 deletion apps/graphs/graphs.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
/**
* @file graphs.cpp
* @author Joe Bayer (joexbayer)
* @brief A simple graph demo
* @version 0.1
* @date 2024-01-10
*
* @copyright Copyright (c) 2024
*
*/

#include <utils/Graphics.hpp>
#include <util.h>
#include <libc.h>
#include <colors.h>
#include <math.h>

Expand Down
Binary file modified apps/libnet.a
Binary file not shown.
2 changes: 1 addition & 1 deletion apps/templates/basic.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include <utils/Graphics.hpp>
#include <util.h>
#include <libc.h>
#include <colors.h>

class Template : public Window {
Expand Down
11 changes: 11 additions & 0 deletions apps/utils/Graphics.hpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
/**
* @file Graphics.hpp
* @author Joe Bayer (joexbayer)
* @brief Graphics library for C++
* @version 0.1
* @date 2024-01-10
*
* @copyright Copyright (c) 2024
*
*/

#ifndef __GRAPHICS_CPP_H
#define __GRAPHICS_CPP_H

Expand Down
11 changes: 11 additions & 0 deletions apps/utils/MsgBox.hpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
/**
* @file MsgBox.hpp
* @author Joe Bayer (joexbayer)
* @brief A message box widget
* @version 0.1
* @date 2024-01-10
*
* @copyright Copyright (c) 2024
*
*/

#ifndef MSGBOX_HPP
#define MSGBOX_HPP

Expand Down
29 changes: 20 additions & 9 deletions apps/utils/StdLib.hpp
Original file line number Diff line number Diff line change
@@ -1,24 +1,35 @@
/**
* @file StdLib.hpp
* @author Joe Bayer (joexbayer)
* @brief A collection of useful C++ utilities
* @version 0.1
* @date 2024-01-10
*
* @copyright Copyright (c) 2024
*
*/

#ifndef STDLIB_HELPER_H
#define STDLIB_HELPER_H

#include <util.h>
#include <libc.h>
#include <stdint.h>
#include "cppUtils.hpp"
#include <lib/syscall.h>

class stdlib {
public:
// Function to find the minimum of two integers
/* Function to find the minimum of two integers */
static int min(int a, int b) {
return (a < b) ? a : b;
}

// Function to find the maximum of two integers
/* Function to find the maximum of two integers */
static int max(int a, int b) {
return (a > b) ? a : b;
}

// Function to calculate the sum of elements in an array
/* Function to calculate the sum of elements in an array */
static int sum(const int* arr, size_t size) {
int result = 0;
for (size_t i = 0; i < size; i++) {
Expand All @@ -27,7 +38,7 @@ class stdlib {
return result;
}

// Function to copy memory from source to destination
/* Function to copy memory from source to destination */
static void* memcpy(void* dest, const void* src, size_t numBytes) {
char* destChar = static_cast<char*>(dest);
const char* srcChar = static_cast<const char*>(src);
Expand All @@ -37,12 +48,12 @@ class stdlib {
return dest;
}

// Function to move memory from source to destination (handles overlapping memory regions)
/* Function to move memory from source to destination (handles overlapping memory regions) */
static void* memmove(void* dest, const void* src, size_t numBytes) {
char* destChar = static_cast<char*>(dest);
const char* srcChar = static_cast<const char*>(src);

// Check if the memory regions overlap and determine the copy direction
/* Check if the memory regions overlap and determine the copy direction */
if (destChar < srcChar) {
for (size_t i = 0; i < numBytes; i++) {
destChar[i] = srcChar[i];
Expand All @@ -56,7 +67,7 @@ class stdlib {
return dest;
}

// Function to set memory to a specific value
/* Function to set memory to a specific value */
static void* memset(void* dest, int value, size_t numBytes) {
char* destChar = static_cast<char*>(dest);
for (size_t i = 0; i < numBytes; i++) {
Expand All @@ -66,4 +77,4 @@ class stdlib {
}
};

#endif // STDLIB_HELPER_H
#endif /* STDLIB_HELPER_H */
13 changes: 12 additions & 1 deletion apps/utils/StringHelper.hpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,18 @@
/**
* @file StringHelper.hpp
* @author Joe Bayer (joexbayer)
* @brief A string helper class
* @version 0.1
* @date 2024-01-10
*
* @copyright Copyright (c) 2024
*
*/

#ifndef STRING_HELPER_H
#define STRING_HELPER_H

#include <util.h>
#include <libc.h>
#include "cppUtils.hpp"
#include <lib/syscall.h>
#include <lib/printf.h>
Expand Down
11 changes: 11 additions & 0 deletions apps/utils/Thread.hpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
/**
* @file Thread.hpp
* @author Joe Bayer (joexbayer)
* @brief RetrOS thread library
* @version 0.1
* @date 2024-01-10
*
* @copyright Copyright (c) 2024
*
*/

#ifndef __THREAD_LIB_HPP
#define __THREAD_LIB_HPP

Expand Down
Loading

0 comments on commit 692c19d

Please sign in to comment.