From 14c302dd6cd219798efc7e2e3ef5330f8ce2db43 Mon Sep 17 00:00:00 2001 From: David Date: Wed, 14 Aug 2013 15:45:55 +1200 Subject: Added license --- Makefile | 12 ++++++++---- TODO.md | 4 ++++ lowlevel.c | 22 ++++++++++++++++++++-- lowlevel.h | 18 ++++++++++++++++++ toast.h | 38 +++++++++++++++++++++++++++++--------- 5 files changed, 79 insertions(+), 15 deletions(-) create mode 100644 TODO.md diff --git a/Makefile b/Makefile index 449916f..534b71c 100644 --- a/Makefile +++ b/Makefile @@ -6,13 +6,17 @@ CFLAGS = -I. -std=gnu99 -ffreestanding -O2 -Wall -Wextra ASFLAGS = -felf LDFLAGS = -Tlink.ld -TOAST_TARGET = ~/toast/toast_img/ -SOURCES = boot.o kernel.o console.o string.o lowlevel.o +TOAST_TARGET = ~/programming/toast/toast_img/ +SOURCES = boot/boot.o \ + screen/console.o \ + string/common.o \ + kernel.o \ + lowlevel.o all: $(SOURCES) link clean: - - rm *.o kernel + - rm *.o */*.o kernel link: - $(LD) $(LDFLAGS) -o kernel $(SOURCES) @@ -22,7 +26,7 @@ link: install: # sudo umount $(TOAST_TARGET) - sudo mount /dev/loop11p1 $(TOAST_TARGET) + sudo mount /dev/loop0p1 $(TOAST_TARGET) sudo cp kernel $(TOAST_TARGET) sudo umount $(TOAST_TARGET) bochs -qf bochsrc diff --git a/TODO.md b/TODO.md new file mode 100644 index 0000000..92ad827 --- /dev/null +++ b/TODO.md @@ -0,0 +1,4 @@ +To do +===== +* Comment code +* Check software license options and possibly relicense diff --git a/lowlevel.c b/lowlevel.c index b305ea4..0fc353a 100644 --- a/lowlevel.c +++ b/lowlevel.c @@ -1,3 +1,21 @@ +/* + * This program 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 2 of the License, or + * (at your option) any later version. + * + * This program 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 this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301, USA. + * + */ + #ifndef LOWLEVEL_C #define LOWLEVEL_C @@ -13,12 +31,12 @@ void outb(uint16_t p,uint8_t val) void disable_ints() { - asm("cli"); + asm("cli"::); } void enable_ints() { - asm("sti"); + asm("sti"::); } #endif \ No newline at end of file diff --git a/lowlevel.h b/lowlevel.h index 8551568..d4dcb55 100644 --- a/lowlevel.h +++ b/lowlevel.h @@ -1,3 +1,21 @@ +/* + * This program 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 2 of the License, or + * (at your option) any later version. + * + * This program 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 this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301, USA. + * + */ + #ifndef LOWLEVEL_H #define LOWLEVEL_H diff --git a/toast.h b/toast.h index 6299fb9..479bd41 100644 --- a/toast.h +++ b/toast.h @@ -1,17 +1,37 @@ -#ifndef __TOAST_H -#define __TOAST_H +/* + * This program 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 2 of the License, or + * (at your option) any later version. + * + * This program 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 this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301, USA. + * + */ + +#ifndef TOAST_H +#define TOAST_H #define KERNEL_VERSION "0.1" -#define KERNEL_NICKNAME "Unstable" +#define KERNEL_NICKNAME "Hydrogen" -#include // Get our booleans defined -#include // uint_8 etc +#include // Get our booleans defined +#include // uint_8 etc -#include -#include -#include +#include // Console output functions +//#include // Console output functions +#include // Low level assembly, eg outb(port,val) +#include // Common string functions +//#include // Common string functions // KERNEL.C void kernel_main(); -#endif \ No newline at end of file +#endif -- cgit v1.1