aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid <dbphillipsnz@gmail.com>2013-08-14 15:45:55 +1200
committerDavid <dbphillipsnz@gmail.com>2014-03-27 20:32:10 +1300
commit14c302dd6cd219798efc7e2e3ef5330f8ce2db43 (patch)
tree9e5593a9979b64838da5f4b955788ab0f61b03b7
parenta6e43b022208908bf6d12f9e65f54c0f84743946 (diff)
downloadtoast-14c302dd6cd219798efc7e2e3ef5330f8ce2db43.tar.xz
Added license
-rw-r--r--Makefile12
-rw-r--r--TODO.md4
-rw-r--r--lowlevel.c22
-rw-r--r--lowlevel.h18
-rw-r--r--toast.h38
5 files changed, 79 insertions, 15 deletions
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 <stdbool.h> // Get our booleans defined
-#include <stdint.h> // uint_8 etc
+#include <stdbool.h> // Get our booleans defined
+#include <stdint.h> // uint_8 etc
-#include <console.h>
-#include <lowlevel.h>
-#include <string.h>
+#include <screen/console.h> // Console output functions
+//#include <console.h> // Console output functions
+#include <lowlevel.h> // Low level assembly, eg outb(port,val)
+#include <string/common.h> // Common string functions
+//#include <string.h> // Common string functions
// KERNEL.C
void kernel_main();
-#endif \ No newline at end of file
+#endif