Refactored all the sortix headers into a include directory.

Also got rid of trailing white space. That corrupted .git/.

Big ass-commit because of recovered .git directory.
This commit is contained in:
Jonas 'Sortie' Termansen 2012-03-22 00:52:29 +01:00
parent e496c07764
commit db79994e64
130 changed files with 346 additions and 282 deletions

View File

@ -17,13 +17,14 @@ ifeq ($(CPU),x64)
endif
LIBMAXSIROOT=$(OSROOT)/libmaxsi
SORTIXROOT=$(OSROOT)/sortix
LIBC=$(LIBMAXSIROOT)/start.o $(LIBMAXSIROOT)/libc.a
LIBS=$(LIBC)
CPPFLAGS=$(CPUDEFINES) -U_GNU_SOURCE -Ulinux -Dsortix
FLAGS=-nostdinc -nostdlib -fno-builtin -nostartfiles -nodefaultlibs
INCLUDES=-I $(LIBMAXSIROOT)/preproc -I $(OSROOT)/
INCLUDES=-I $(LIBMAXSIROOT)/preproc -I $(SORTIXROOT)/include
LD=ld
LDFLAGS=$(CPULDFLAGS)

View File

@ -19,7 +19,7 @@ ifeq ($(CPU),x64)
CPUASFLAGS=-64
endif
CPPINCLUDES=-I preproc -I ..
CPPINCLUDES=-I preproc -I ../sortix/include
CPPFLAGS=-DLIBMAXSI_LIBRARY -DSORTIX -U_GNU_SOURCE $(CPUDEFINES) $(CPPINCLUDES)
FLAGS=$(CPUFLAGS) -Wall -Wextra -nostdlib -fno-builtin -nostartfiles \
-nodefaultlibs -fno-stack-protector -nostdinc

View File

@ -37,10 +37,10 @@
#define PARANOIA 1
#ifdef SORTIX_KERNEL
#include <sortix/platform.h>
#include <sortix/log.h> // DEBUG
#include <sortix/memorymanagement.h>
#include <sortix/panic.h>
#include <sortix/kernel/platform.h>
#include <sortix/kernel/log.h> // DEBUG
#include <sortix/kernel/memorymanagement.h>
#include <sortix/kernel/panic.h>
#endif
namespace Maxsi

View File

@ -80,8 +80,8 @@
#endif
#ifdef SORTIX_KERNEL
#include <sortix/platform.h>
#include <sortix/log.h>
#include <sortix/panic.h>
#include <sortix/kernel/platform.h>
#include <sortix/kernel/log.h>
#include <sortix/kernel/panic.h>
#endif

View File

@ -1,4 +1,4 @@
CPPFLAGS=-I..
CPPFLAGS=-I../sortix/include
CXXFLAGS=-Wall
BINARIES=mkinitrd lsinitrd catinitrd

View File

@ -69,7 +69,7 @@ ifdef VERSION
DEFINES:=$(DEFINES) -DVERSIONSTR=\"$(VERSION)\"
endif
INCLUDES=-I../libmaxsi/preproc -I.. -I.
INCLUDES=-I. -Iinclude -I../libmaxsi/preproc
CPPFLAGS=$(INCLUDES) $(DEFINES)
FLAGSRELEASE=-s $(O)
FLAGSDEBUG=
@ -83,17 +83,8 @@ NASMFLAGS=$(CPUNASMFLAGS)
STATICLIBS=\
../libmaxsi/libmaxsi-sortix.a \
PUBLICHEADERS=\
$(CPU)/bits.h \
fcntl.h \
initrd.h \
seek.h \
keycodes.h \
termmode.h \
syscallnum.h \
stat.h \
timeval.h \
unistd.h \
HEADERDIRS:=$(shell find include -type d)
HEADERS:=$(shell find include -type f)
OBJS=$(CPUOBJS) \
kernel.o \
@ -185,8 +176,10 @@ clean:
# Installation into sysroot
install:
mkdir -p $(SYSROOT)/usr/include/sortix
for FILE in $(PUBLICHEADERS); do \
cp $$FILE $(SYSROOT)/usr/include/sortix/`basename $$FILE`; \
for DIR in $(HEADERDIRS); do \
mkdir -p $(SYSROOT)/usr/$$DIR; \
done
for FILE in $(HEADERS); do \
cp $$FILE $(SYSROOT)/usr/$$FILE; \
done

View File

@ -22,7 +22,8 @@
******************************************************************************/
#include "platform.h"
#include <sortix/kernel/platform.h>
#include "cpu.h"
#include <libmaxsi/error.h>
#include <libmaxsi/memory.h>
#include "ata.h"

View File

@ -22,7 +22,7 @@
*******************************************************************************/
#include "platform.h"
#include <sortix/kernel/platform.h>
#include "calltrace.h"
namespace Sortix {

View File

@ -22,7 +22,7 @@
*******************************************************************************/
#include "platform.h"
#include <sortix/kernel/platform.h>
#include <libmaxsi/error.h>
#include "interrupt.h"
#include "event.h"

38
sortix/cpu.h Normal file
View File

@ -0,0 +1,38 @@
/*******************************************************************************
COPYRIGHT(C) JONAS 'SORTIE' TERMANSEN 2011, 2012.
This file is part of Sortix.
Sortix is free software: you can redistribute it and/or modify it under the
terms of the GNU General Public License as published by the Free Software
Foundation, either version 3 of the License, or (at your option) any later
version.
Sortix is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
details.
You should have received a copy of the GNU General Public License along with
Sortix. If not, see <http://www.gnu.org/licenses/>.
cpu.h
Includes CPU-specific headers.
*******************************************************************************/
#ifndef SORTIX_CPU_H
#define SORTIX_CPU_H
// Include some x86 headers.
#ifdef PLATFORM_X86
#include "x86/x86.h"
#endif
// Include some x64 headers.
#ifdef PLATFORM_X64
#include "x64/x64.h"
#endif
#endif

View File

@ -22,7 +22,7 @@
*******************************************************************************/
#include "platform.h"
#include <sortix/kernel/platform.h>
#include <libmaxsi/memory.h>
#include "descriptors.h"
#include "device.h"

View File

@ -22,7 +22,7 @@
******************************************************************************/
#include "platform.h"
#include <sortix/kernel/platform.h>
#include <libmaxsi/memory.h>
#include "device.h"

View File

@ -22,7 +22,7 @@
******************************************************************************/
#include "platform.h"
#include <sortix/kernel/platform.h>
#include <libmaxsi/error.h>
#include <libmaxsi/memory.h>
#include <libmaxsi/string.h>

View File

@ -22,12 +22,12 @@
******************************************************************************/
#include "platform.h"
#include <sortix/kernel/platform.h>
#include <libmaxsi/error.h>
#include <libmaxsi/memory.h>
#include "elf.h"
#include "memorymanagement.h"
#include "panic.h"
#include <sortix/kernel/memorymanagement.h>
#include <sortix/kernel/panic.h>
#include "process.h"
using namespace Maxsi;

View File

@ -24,7 +24,7 @@
******************************************************************************/
#include "platform.h"
#include <sortix/kernel/platform.h>
namespace Sortix
{

View File

@ -22,7 +22,7 @@
******************************************************************************/
#include "platform.h"
#include <sortix/kernel/platform.h>
#include "thread.h"
#include "syscall.h"
#include "event.h"

View File

@ -22,7 +22,7 @@
******************************************************************************/
#include "platform.h"
#include <sortix/kernel/platform.h>
#include <libmaxsi/error.h>
#include <libmaxsi/memory.h>
#include <libmaxsi/string.h>

View File

@ -22,7 +22,7 @@
******************************************************************************/
#include "../platform.h"
#include <sortix/kernel/platform.h>
#include <libmaxsi/error.h>
#include <libmaxsi/string.h>
#include <libmaxsi/memory.h>

View File

@ -22,7 +22,7 @@
******************************************************************************/
#include "../platform.h"
#include <sortix/kernel/platform.h>
#include <libmaxsi/error.h>
#include <libmaxsi/string.h>
#include <libmaxsi/memory.h>

View File

@ -22,7 +22,7 @@
******************************************************************************/
#include "../platform.h"
#include <sortix/kernel/platform.h>
#include <libmaxsi/error.h>
#include <libmaxsi/string.h>
#include <libmaxsi/memory.h>

View File

@ -0,0 +1,59 @@
/******************************************************************************
COPYRIGHT(C) JONAS 'SORTIE' TERMANSEN 2011.
This file is part of Sortix.
Sortix is free software: you can redistribute it and/or modify it under the
terms of the GNU General Public License as published by the Free Software
Foundation, either version 3 of the License, or (at your option) any later
version.
Sortix is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
details.
You should have received a copy of the GNU General Public License along
with Sortix. If not, see <http://www.gnu.org/licenses/>.
initrd.h
Declares the structure of the Sortix ramdisk.
******************************************************************************/
#ifndef SORTIX_INITRD_H
#define SORTIX_INITRD_H
namespace Sortix
{
namespace InitRD
{
struct Header;
struct FileHeader;
struct Header
{
char magic[16]; // Contains "sortix-initrd-1"
uint32_t numfiles;
// FileHeader[numfiles];
};
struct FileHeader
{
mode_t permissions;
uid_t owner;
gid_t group;
uint32_t size;
uint32_t offset; // where the physical data is located.
char name[128];
};
struct Trailer
{
uint8_t sum; // sum of all bytes but the trailer.
};
}
}
#endif

View File

@ -68,15 +68,5 @@
#define USER
// Include some x86 headers.
#ifdef PLATFORM_X86
#include "x86/x86.h"
#endif
// Include some x64 headers.
#ifdef PLATFORM_X64
#include "x64/x64.h"
#endif
#endif

View File

@ -22,14 +22,15 @@
******************************************************************************/
#include "platform.h"
#include <sortix/kernel/platform.h>
#include <sortix/initrd.h>
#include "initrd.h"
#include <libmaxsi/memory.h>
#include <libmaxsi/string.h>
#include "syscall.h"
#include "memorymanagement.h"
#include <sortix/kernel/memorymanagement.h>
#include "log.h" // DEBUG
#include <sortix/kernel/log.h> // DEBUG
using namespace Maxsi;

View File

@ -22,44 +22,17 @@
******************************************************************************/
#ifndef SORTIX_INITRD_H
#define SORTIX_INITRD_H
#ifndef SORTIX_INITRD_KERNEL_H
#define SORTIX_INITRD_KERNEL_H
namespace Sortix
{
namespace InitRD
{
struct Header;
struct FileHeader;
struct Header
{
char magic[16]; // Contains "sortix-initrd-1"
uint32_t numfiles;
// FileHeader[numfiles];
};
struct FileHeader
{
mode_t permissions;
uid_t owner;
gid_t group;
uint32_t size;
uint32_t offset; // where the physical data is located.
char name[128];
};
struct Trailer
{
uint8_t sum; // sum of all bytes but the trailer.
};
#ifdef SORTIX_KERNEL
void Init(addr_t phys, size_t size);
byte* Open(const char* filepath, size_t* size);
const char* GetFilename(size_t index);
size_t GetNumFiles();
#endif
}
}

View File

@ -22,7 +22,7 @@
*******************************************************************************/
#include "platform.h"
#include <sortix/kernel/platform.h>
#include "x86-family/idt.h"
#include "interrupt.h"

View File

@ -25,6 +25,8 @@
#ifndef SORTIX_INTERRUPT_H
#define SORTIX_INTERRUPT_H
#include "cpu.h"
namespace Sortix {
namespace Interrupt {

View File

@ -22,7 +22,7 @@
******************************************************************************/
#include "platform.h"
#include <sortix/kernel/platform.h>
#include <libmaxsi/error.h>
#include <sortix/seek.h>
#include "thread.h"

View File

@ -22,9 +22,9 @@
******************************************************************************/
#include "../../platform.h"
#include <sortix/kernel/platform.h>
#include "../../keyboard.h"
#include "../../keycodes.h"
#include <sortix/keycodes.h>
#include "us.h"
namespace Sortix

View File

@ -22,11 +22,11 @@
******************************************************************************/
#include "../platform.h"
#include <sortix/kernel/platform.h>
#include <libmaxsi/memory.h>
#include "../interrupt.h"
#include "../keyboard.h"
#include "../keycodes.h"
#include <sortix/keycodes.h>
#include "ps2.h"
using namespace Maxsi;

View File

@ -23,18 +23,18 @@
*******************************************************************************/
#include "platform.h"
#include <sortix/kernel/platform.h>
#include <libmaxsi/memory.h>
#include <libmaxsi/string.h>
#include <libmaxsi/format.h>
#include "log.h"
#include "panic.h"
#include <sortix/kernel/log.h>
#include <sortix/kernel/panic.h>
#include "kernelinfo.h"
#include "x86-family/gdt.h"
#include "time.h"
#include "keyboard.h"
#include "multiboot.h"
#include "memorymanagement.h"
#include <sortix/kernel/memorymanagement.h>
#include "thread.h"
#include "process.h"
#include "scheduler.h"

View File

@ -22,7 +22,7 @@
*******************************************************************************/
#include "platform.h"
#include <sortix/kernel/platform.h>
#include <libmaxsi/error.h>
#include <libmaxsi/string.h>
#include "syscall.h"

View File

@ -22,7 +22,7 @@
******************************************************************************/
#include "platform.h"
#include <sortix/kernel/platform.h>
#include "interrupt.h"
#include "syscall.h"
#include "keyboard.h"

View File

@ -22,7 +22,7 @@
******************************************************************************/
#include "platform.h"
#include <sortix/kernel/platform.h>
#include <libmaxsi/memory.h>
#include "linebuffer.h"

View File

@ -22,10 +22,10 @@
******************************************************************************/
#include "platform.h"
#include <sortix/kernel/platform.h>
#include <libmaxsi/string.h>
#include <libmaxsi/memory.h>
#include "log.h"
#include <sortix/kernel/log.h>
#include "syscall.h"
using namespace Maxsi;

View File

@ -22,13 +22,13 @@
******************************************************************************/
#include "platform.h"
#include <sortix/kernel/platform.h>
#include <libmaxsi/error.h>
#include <libmaxsi/memory.h>
#include "utf8.h"
#include "keyboard.h"
#include "scheduler.h"
#include "keycodes.h"
#include <sortix/keycodes.h>
#include "terminal.h"
#include "logterminal.h"

View File

@ -22,10 +22,10 @@
******************************************************************************/
#include "platform.h"
#include <sortix/kernel/platform.h>
#include <libmaxsi/memory.h>
#include <libmaxsi/string.h>
#include "panic.h"
#include <sortix/kernel/panic.h>
#include "mount.h"
#include "fs/ramfs.h"
#include "fs/initfs.h"

View File

@ -22,12 +22,12 @@
******************************************************************************/
#include "platform.h"
#include <sortix/kernel/platform.h>
#include <libmaxsi/string.h>
#include <libmaxsi/memory.h>
#include "log.h"
#include <sortix/kernel/log.h>
#include "calltrace.h"
#include "panic.h"
#include <sortix/kernel/panic.h>
using namespace Maxsi;

View File

@ -22,10 +22,11 @@
******************************************************************************/
#include "platform.h"
#include <sortix/kernel/platform.h>
#include "cpu.h"
#include <libmaxsi/error.h>
#include "pci.h"
#include "log.h"
#include <sortix/kernel/log.h>
#include "ata.h"
using namespace Maxsi;

View File

@ -22,7 +22,7 @@
******************************************************************************/
#include "platform.h"
#include <sortix/kernel/platform.h>
#include <libmaxsi/error.h>
#include <libmaxsi/memory.h>
#include "event.h"

View File

@ -22,7 +22,7 @@
******************************************************************************/
#include "platform.h"
#include <sortix/kernel/platform.h>
#include <libmaxsi/error.h>
#include <libmaxsi/memory.h>
#include <libmaxsi/string.h>
@ -34,7 +34,7 @@
#include "filesystem.h"
#include "directory.h"
#include "scheduler.h"
#include "memorymanagement.h"
#include <sortix/kernel/memorymanagement.h>
#include "initrd.h"
#include "elf.h"
#include "syscall.h"

View File

@ -26,6 +26,7 @@
#define SORTIX_PROCESS_H
#include "descriptors.h"
#include "cpu.h"
namespace Sortix
{

View File

@ -22,7 +22,7 @@
*******************************************************************************/
#include "platform.h"
#include <sortix/kernel/platform.h>
#include "refcount.h"
namespace Sortix

View File

@ -22,14 +22,14 @@
******************************************************************************/
#include "platform.h"
#include <sortix/kernel/platform.h>
#include <libmaxsi/memory.h>
#include "panic.h"
#include <sortix/kernel/panic.h>
#include "thread.h"
#include "process.h"
#include "time.h"
#include "scheduler.h"
#include "memorymanagement.h"
#include <sortix/kernel/memorymanagement.h>
#include "syscall.h"
#include "sound.h" // HACK FOR SIGINT
#include "x86-family/gdt.h"

View File

@ -22,9 +22,9 @@
******************************************************************************/
#include "platform.h"
#include <sortix/kernel/platform.h>
#include <libmaxsi/string.h>
#include "log.h"
#include <sortix/kernel/log.h>
#include "vga.h"
#include "keyboard.h"
#include "uart.h"

View File

@ -22,9 +22,9 @@
******************************************************************************/
#include "platform.h"
#include <sortix/kernel/platform.h>
#include <libmaxsi/memory.h>
#include "panic.h"
#include <sortix/kernel/panic.h>
#include "signal.h"
using namespace Maxsi;

View File

@ -26,6 +26,7 @@
#define SORTIX_SIGNAL_H
#include <libmaxsi/signalnum.h>
#include "cpu.h"
namespace Sortix
{

View File

@ -22,7 +22,7 @@
******************************************************************************/
#include "platform.h"
#include <sortix/kernel/platform.h>
#include "sound.h"
#include "syscall.h"

View File

@ -22,11 +22,11 @@
******************************************************************************/
#include "platform.h"
#include <sortix/kernel/platform.h>
#include <libmaxsi/error.h>
#include "syscall.h"
#include "syscallnum.h"
#include "panic.h"
#include <sortix/syscallnum.h>
#include <sortix/kernel/panic.h>
#include "process.h"
#include "thread.h"
#include "scheduler.h"

View File

@ -25,7 +25,8 @@
#ifndef SORTIX_SYSCALL_H
#define SORTIX_SYSCALL_H
#include "syscallnum.h"
#include <sortix/syscallnum.h>
#include "cpu.h"
namespace Sortix
{

View File

@ -22,7 +22,7 @@
******************************************************************************/
#include "platform.h"
#include <sortix/kernel/platform.h>
#include <libmaxsi/error.h>
#include "syscall.h"
#include "process.h"

View File

@ -28,7 +28,7 @@
#include "device.h"
#include "stream.h"
#include "termmode.h"
#include <sortix/termmode.h>
namespace Sortix
{

View File

@ -22,14 +22,14 @@
******************************************************************************/
#include "platform.h"
#include <sortix/kernel/platform.h>
#include <libmaxsi/error.h>
#include <libmaxsi/memory.h>
#include "event.h"
#include "process.h"
#include "thread.h"
#include "scheduler.h"
#include "memorymanagement.h"
#include <sortix/kernel/memorymanagement.h>
#include "time.h"
#include "syscall.h"

View File

@ -23,12 +23,12 @@
******************************************************************************/
#include "platform.h"
#include <sortix/kernel/platform.h>
#include "time.h"
#include "interrupt.h"
#include "process.h"
#include "scheduler.h"
#include "log.h"
#include <sortix/kernel/log.h>
#include "sound.h"
#include "syscall.h"

View File

@ -26,6 +26,8 @@
#ifndef SORTIX_TIME_H
#define SORTIX_TIME_H
#include "cpu.h"
namespace Sortix
{
namespace Time

View File

@ -22,7 +22,8 @@
******************************************************************************/
#include "platform.h"
#include <sortix/kernel/platform.h>
#include "cpu.h"
#include <libmaxsi/string.h>
#include <libmaxsi/memory.h>
#include "vga.h"

View File

@ -22,7 +22,7 @@
******************************************************************************/
#include "platform.h"
#include <sortix/kernel/platform.h>
#include <libmaxsi/error.h>
#include "utf8.h"

View File

@ -22,11 +22,10 @@
******************************************************************************/
#include "platform.h"
#include <sortix/kernel/platform.h>
#include <libmaxsi/error.h>
#include <libmaxsi/memory.h>
#include "vga.h"
#include "memorymanagement.h"
#include "scheduler.h"
#include "syscall.h"
#include "process.h"

View File

@ -22,8 +22,8 @@
******************************************************************************/
#include "platform.h"
#include "log.h"
#include <sortix/kernel/platform.h>
#include <sortix/kernel/log.h>
#include "vga.h"
#include "vgaterminal.h"

View File

@ -22,11 +22,11 @@
******************************************************************************/
#include "platform.h"
#include <sortix/kernel/platform.h>
#include <libmaxsi/memory.h>
#include "multiboot.h"
#include "panic.h"
#include "../memorymanagement.h"
#include <sortix/kernel/panic.h>
#include <sortix/kernel/memorymanagement.h>
#include "x86-family/memorymanagement.h"
namespace Sortix

View File

@ -22,7 +22,7 @@
******************************************************************************/
#include "platform.h"
#include <sortix/kernel/platform.h>
#include "process.h"
namespace Sortix

View File

@ -22,9 +22,9 @@
******************************************************************************/
#include "platform.h"
#include <sortix/kernel/platform.h>
#include <sortix/kernel/memorymanagement.h>
#include "scheduler.h"
#include "../memorymanagement.h"
namespace Sortix
{

View File

@ -22,7 +22,7 @@
******************************************************************************/
#include "platform.h"
#include <sortix/kernel/platform.h>
#include "thread.h"
namespace Sortix

View File

@ -24,7 +24,7 @@
#include <libmaxsi/platform.h>
#include "x64.h"
#include "log.h"
#include <sortix/kernel/log.h>
namespace Sortix
{

View File

@ -22,7 +22,7 @@
*******************************************************************************/
#include "../platform.h"
#include <sortix/kernel/platform.h>
#include <libmaxsi/memory.h>
#include "gdt.h"

View File

@ -22,7 +22,7 @@
*******************************************************************************/
#include "../platform.h"
#include <sortix/kernel/platform.h>
#include <libmaxsi/memory.h>
#include "idt.h"

View File

@ -22,12 +22,12 @@
******************************************************************************/
#include "platform.h"
#include <sortix/kernel/platform.h>
#include <libmaxsi/error.h>
#include <libmaxsi/memory.h>
#include "multiboot.h"
#include "panic.h"
#include "../memorymanagement.h"
#include <sortix/kernel/panic.h>
#include <sortix/kernel/memorymanagement.h>
#include "memorymanagement.h"
#include "syscall.h"

View File

@ -22,11 +22,11 @@
******************************************************************************/
#include "platform.h"
#include <sortix/kernel/platform.h>
#include <libmaxsi/memory.h>
#include "multiboot.h"
#include "panic.h"
#include "../memorymanagement.h"
#include <sortix/kernel/panic.h>
#include <sortix/kernel/memorymanagement.h>
#include "x86-family/memorymanagement.h"
namespace Sortix

View File

@ -22,7 +22,7 @@
******************************************************************************/
#include "platform.h"
#include <sortix/kernel/platform.h>
#include "process.h"
namespace Sortix

View File

@ -22,9 +22,9 @@
******************************************************************************/
#include "platform.h"
#include <sortix/kernel/platform.h>
#include "scheduler.h"
#include "../memorymanagement.h"
#include <sortix/kernel/memorymanagement.h>
namespace Sortix
{

View File

@ -22,7 +22,7 @@
******************************************************************************/
#include "platform.h"
#include <sortix/kernel/platform.h>
#include "thread.h"
namespace Sortix

View File

@ -24,7 +24,7 @@
#include <libmaxsi/platform.h>
#include "x86.h"
#include "log.h"
#include <sortix/kernel/log.h>
namespace Sortix
{