Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
name: Build

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

on:
push:
branches:
Expand Down
1 change: 0 additions & 1 deletion applications/core/src-ls/ls.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
* *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

#include <ghost.h>
#include <stdio.h>
#include <string.h>

Expand Down
1 change: 0 additions & 1 deletion applications/core/src-read/read.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
* *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

#include <ghost.h>
#include <stdint.h>
#include <stdio.h>
#include <string.h>
Expand Down
1 change: 0 additions & 1 deletion applications/core/src-write/write.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
* *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

#include <ghost.h>
#include <stdint.h>
#include <stdio.h>
#include <string.h>
Expand Down
31 changes: 15 additions & 16 deletions applications/libps2/src/ps2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@
#include "libps2/ps2.hpp"
#include "ps2_intern.hpp"

#include <ghost/io.h>
#include <ghost/user.h>
#include <ghost.h>
#include <stdio.h>

uint8_t mouse_packet_number = 0;
Expand Down Expand Up @@ -79,9 +78,9 @@ void ps2ReadMouseIrq()
void ps2IrqHandler(uint8_t irq)
{
uint8_t status;
while(((status = ioInportByte(G_PS2_STATUS_PORT)) & 0x01) != 0)
while(((status = g_io_port_read_byte(G_PS2_STATUS_PORT)) & 0x01) != 0)
{
uint8_t value = ioInportByte(G_PS2_DATA_PORT);
uint8_t value = g_io_port_read_byte(G_PS2_DATA_PORT);

if((status & 0x20) == 0)
{
Expand All @@ -103,28 +102,28 @@ ps2_status_t ps2InitializeMouse()
{

// empty input buffer
while(ioInportByte(G_PS2_STATUS_PORT) & 0x01)
while(g_io_port_read_byte(G_PS2_STATUS_PORT) & 0x01)
{
ioInportByte(G_PS2_DATA_PORT);
g_io_port_read_byte(G_PS2_DATA_PORT);
}

// activate mouse device
ps2WaitForBuffer(PS2_OUT);
ioOutportByte(G_PS2_STATUS_PORT, 0xA8);
g_io_port_write_byte(G_PS2_STATUS_PORT, 0xA8);
ps2WaitForBuffer(PS2_IN);
ioInportByte(G_PS2_DATA_PORT);
g_io_port_read_byte(G_PS2_DATA_PORT);

// get commando-byte, set bit 1 (enables IRQ12), send back
ps2WaitForBuffer(PS2_OUT);
ioOutportByte(G_PS2_STATUS_PORT, 0x20);
g_io_port_write_byte(G_PS2_STATUS_PORT, 0x20);

ps2WaitForBuffer(PS2_IN);
uint8_t status = (ioInportByte(G_PS2_DATA_PORT) | 0x02) & (~0x10);
uint8_t status = (g_io_port_read_byte(G_PS2_DATA_PORT) | 0x02) & (~0x10);

ps2WaitForBuffer(PS2_OUT);
ioOutportByte(G_PS2_STATUS_PORT, 0x60);
g_io_port_write_byte(G_PS2_STATUS_PORT, 0x60);
ps2WaitForBuffer(PS2_OUT);
ioOutportByte(G_PS2_DATA_PORT, status);
g_io_port_write_byte(G_PS2_DATA_PORT, status);

// send set-default-settings command to mouse
if(ps2WriteToMouse(0xF6))
Expand Down Expand Up @@ -213,7 +212,7 @@ void ps2WaitForBuffer(ps2_buffer_t buffer)
int timeout = 100;
while(timeout--)
{
if((ioInportByte(G_PS2_STATUS_PORT) & requiredBit) == requiredValue)
if((g_io_port_read_byte(G_PS2_STATUS_PORT) & requiredBit) == requiredValue)
{
return;
}
Expand All @@ -225,13 +224,13 @@ int ps2WriteToMouse(uint8_t value)
{

ps2WaitForBuffer(PS2_OUT);
ioOutportByte(G_PS2_STATUS_PORT, 0xD4);
g_io_port_write_byte(G_PS2_STATUS_PORT, 0xD4);

ps2WaitForBuffer(PS2_OUT);
ioOutportByte(G_PS2_DATA_PORT, value);
g_io_port_write_byte(G_PS2_DATA_PORT, value);

ps2WaitForBuffer(PS2_IN);
if(ioInportByte(G_PS2_DATA_PORT) != 0xFA)
if(g_io_port_read_byte(G_PS2_DATA_PORT) != 0xFA)
{
return 1;
}
Expand Down
11 changes: 6 additions & 5 deletions applications/pcidriver/src/pcidriver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,12 @@
* *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

#include "pcidriver.hpp"

#include <cstdio>
#include <libpci/pci.hpp>
#include <libpci/driver.hpp>
#include <ghost/io.h>
#include "pcidriver.hpp"
#include <ghost.h>

g_user_mutex pciLock = g_mutex_initialize();

Expand All @@ -35,7 +36,7 @@ int main()

if(!g_task_register_id(G_PCI_DRIVER_IDENTIFIER))
{
klog("PCI driver failed to register with identifier '%s'",G_PCI_DRIVER_IDENTIFIER);
klog("PCI driver failed to register with identifier '%s'", G_PCI_DRIVER_IDENTIFIER);
return -1;
}
pciDriverReceiveMessages();
Expand Down Expand Up @@ -136,8 +137,8 @@ uint32_t pciReadConfigInt(uint8_t bus, uint8_t device, uint8_t function, uint8_t
uint32_t address = (1 << 31) | (bus << 16) | (device << 11) | (function << 8) | (offset);

g_mutex_acquire(pciLock);
ioOutportInt(PCI_CONFIG_PORT_ADDR, address);
auto result = ioInportInt(PCI_CONFIG_PORT_DATA);
g_io_port_write_dword(PCI_CONFIG_PORT_ADDR, address);
auto result = g_io_port_read_dword(PCI_CONFIG_PORT_DATA);
g_mutex_release(pciLock);
return result;
}
Expand Down
3 changes: 3 additions & 0 deletions applications/pcidriver/src/pcidriver.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@
#ifndef __PCIDRIVER__
#define __PCIDRIVER__

#include <stdint.h>
#include <ghost.h>

struct g_pci_device
{
uint8_t bus;
Expand Down
3 changes: 1 addition & 2 deletions applications/proc/src/list/list.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@

#include "list.hpp"

#include <ghost/kernquery.h>
#include <ghost/user.h>
#include <ghost.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
Expand Down
4 changes: 2 additions & 2 deletions applications/terminal/src/screen/gui/terminal_document.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@
#ifndef __TERMINAL_DOCUMENT__
#define __TERMINAL_DOCUMENT__

#include <ghost/user.h>

#include "terminal_line.hpp"

#include <ghost.h>

struct terminal_row_t
{
char* start;
Expand Down
17 changes: 8 additions & 9 deletions applications/terminal/src/screen/headless_screen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@

#include "headless_screen.hpp"
#include <ghost.h>
#include <ghost/io.h>
#include <libps2driver/ps2driver.hpp>
#include <string.h>

Expand Down Expand Up @@ -61,21 +60,21 @@ void headless_screen_t::clean()

void headless_screen_t::enableCursor()
{
ioOutportByte(0x3D4, 0x0A);
ioOutportByte(0x3D5, (ioInportByte(0x3D5) & 0xC0) | 0);
ioOutportByte(0x3D4, 0x0B);
ioOutportByte(0x3D5, (ioInportByte(0x3D5) & 0xE0) | SCREEN_HEIGHT);
g_io_port_write_byte(0x3D4, 0x0A);
g_io_port_write_byte(0x3D5, (g_io_port_read_byte(0x3D5) & 0xC0) | 0);
g_io_port_write_byte(0x3D4, 0x0B);
g_io_port_write_byte(0x3D5, (g_io_port_read_byte(0x3D5) & 0xE0) | SCREEN_HEIGHT);
}

void headless_screen_t::updateCursor()
{
g_mutex_acquire(lock);

uint16_t position = (getCursorY() * SCREEN_WIDTH) + getCursorX();
ioOutportByte(0x3D4, 0x0F);
ioOutportByte(0x3D5, (uint8_t) (position & 0xFF));
ioOutportByte(0x3D4, 0x0E);
ioOutportByte(0x3D5, (uint8_t) ((position >> 8) & 0xFF));
g_io_port_write_byte(0x3D4, 0x0F);
g_io_port_write_byte(0x3D5, (uint8_t) (position & 0xFF));
g_io_port_write_byte(0x3D4, 0x0E);
g_io_port_write_byte(0x3D5, (uint8_t) ((position >> 8) & 0xFF));

g_mutex_release(lock);
}
Expand Down
2 changes: 1 addition & 1 deletion applications/windowserver/src/components/canvas.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

#include "components/canvas.hpp"
#include "windowserver.hpp"
#include <ghost/memory.h>
#include <ghost.h>
#include <string.h>

#define ALIGN_UP(value) (value + value % 100)
Expand Down
4 changes: 2 additions & 2 deletions kernel/inc/build_config.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@

// version
#define G_VERSION_MAJOR 0
#define G_VERSION_MINOR 15
#define G_VERSION_PATCH 2
#define G_VERSION_MINOR 16
#define G_VERSION_PATCH 0

#define G_LOADER_VERSION_MAJOR 1
#define G_LOADER_VERSION_MINOR 1
Expand Down
2 changes: 1 addition & 1 deletion kernel/inc/shared/debug/debug_interface.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
#ifndef __GHOST_DEBUG_INTERFACE__
#define __GHOST_DEBUG_INTERFACE__

#include "ghost/stdint.h"
#include <ghost/stdint.h>
#include "build_config.hpp"

#include "shared/debug/debug_protocol.hpp"
Expand Down
2 changes: 1 addition & 1 deletion kernel/inc/shared/logger/logger.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
#define __LOGGER__

#include "stdarg.h"
#include "ghost/stdint.h"
#include <ghost/stdint.h>

#include "shared/logger/logger_macros.hpp"

Expand Down
8 changes: 4 additions & 4 deletions kernel/inc/shared/memory/bitmap_page_allocator.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@
#ifndef __BITMAP_PAGE_ALLOCATOR__
#define __BITMAP_PAGE_ALLOCATOR__

#include "ghost/types.h"
#include "shared/memory/bitmap.hpp"
#include "shared/system/mutex.hpp"

#include <ghost/stdint.h>

struct g_bitmap_page_allocator
{
uint32_t freePageCount;
g_bitmap_header* bitmapArray;
uint32_t freePageCount;
g_bitmap_header* bitmapArray;
};

/**
Expand Down
2 changes: 1 addition & 1 deletion kernel/inc/shared/memory/gdt.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
#ifndef __GDT__
#define __GDT__

#include "ghost/stdint.h"
#include <ghost/stdint.h>
#include "shared/memory/gdt_macros.hpp"

/**
Expand Down
1 change: 0 additions & 1 deletion kernel/inc/shared/memory/memory.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@

#include "shared/memory/bitmap_page_allocator.hpp"
#include <ghost/stdint.h>
#include <ghost/types.h>
#include <stddef.h>

#define G_ALIGN_UP(value, alignment) ((value % alignment) ? (value + (alignment - value % alignment)) : value)
Expand Down
4 changes: 2 additions & 2 deletions kernel/inc/shared/memory/paging.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
#ifndef __PAGING__
#define __PAGING__

#include "ghost/memory.h"
#include "ghost/types.h"
#include <ghost/memory/types.h>
#include <ghost/stdint.h>

#define G_PAGE_TABLE_PRESENT (1)
#define G_PAGE_TABLE_READWRITE (1 << 1)
Expand Down
2 changes: 1 addition & 1 deletion kernel/inc/shared/memory/tss.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
#ifndef __GDT_TSS__
#define __GDT_TSS__

#include "ghost/stdint.h"
#include <ghost/stdint.h>

/**
* Structure of the x86 task state segment.
Expand Down
2 changes: 1 addition & 1 deletion kernel/inc/shared/multiboot/multiboot.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
#ifndef __MULTIBOOT__
#define __MULTIBOOT__

#include "ghost/stdint.h"
#include <ghost/stdint.h>

#define G_MULTIBOOT_HEADER_MAGIC 0x1BADB002
#define G_MULTIBOOT_BOOTLOADER_MAGIC 0x2BADB002
Expand Down
2 changes: 1 addition & 1 deletion kernel/inc/shared/setup_information.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
#ifndef __SETUP_INFORMATION__
#define __SETUP_INFORMATION__

#include "ghost/types.h"
#include <ghost/memory/types.h>
#include "shared/multiboot/multiboot.hpp"

/**
Expand Down
2 changes: 1 addition & 1 deletion kernel/inc/shared/system/bios_data_area.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
#ifndef __BIOS_DATA_AREA__
#define __BIOS_DATA_AREA

#include "ghost/stdint.h"
#include <ghost/stdint.h>

/**
* COM port information within the BIOS data area
Expand Down
2 changes: 1 addition & 1 deletion kernel/inc/shared/system/io_port.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
#ifndef __IO_PORTS__
#define __IO_PORTS__

#include "ghost/stdint.h"
#include <ghost/stdint.h>

uint8_t ioPortReadByte(uint16_t port);

Expand Down
2 changes: 1 addition & 1 deletion kernel/inc/shared/system/mutex.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
#ifndef __SYSTEM_MUTEX__
#define __SYSTEM_MUTEX__

#include "ghost/stdint.h"
#include <ghost/stdint.h>
#include "shared/logger/logger.hpp"
#include "shared/system/spinlock.hpp"

Expand Down
2 changes: 1 addition & 1 deletion kernel/inc/shared/system/serial_port.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
#ifndef __SERIAL_PORT__
#define __SERIAL_PORT__

#include "ghost/stdint.h"
#include <ghost/stdint.h>

#define G_SERIAL_PORT_OFFSET_DATA_REGISTER 0 // without DLAB, register for receiving and writing
#define G_SERIAL_PORT_OFFSET_INTERRUPT_ENABLE 1 // without DLAB, interrupt enable register
Expand Down
2 changes: 1 addition & 1 deletion kernel/inc/shared/utils/string.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
#ifndef __UTILS_STRING__
#define __UTILS_STRING__

#include "ghost/stdint.h"
#include <ghost/stdint.h>
#include <stddef.h>

void stringConcat(const char* a, const char* b, char* out);
Expand Down
2 changes: 1 addition & 1 deletion kernel/inc/shared/video/console_video.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
#define __CONSOLE_VIDEO__

#include <stdarg.h>
#include "ghost/stdint.h"
#include <ghost/stdint.h>

#define G_CONSOLE_VIDEO_MEMORY 0xB8000
#define G_CONSOLE_VIDEO_WIDTH 80
Expand Down
2 changes: 1 addition & 1 deletion kernel/inc/shared/video/pretty_boot.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
#define __PRETTY_BOOT__

#include "build_config.hpp"
#include "ghost/stdint.h"
#include <ghost/stdint.h>
#include <stdarg.h>

#define G_PRETTY_BOOT_PROGRESS_BAR_Y_POS 15
Expand Down
Loading
Loading