Skip to content

Commit

Permalink
Import current version to GIT
Browse files Browse the repository at this point in the history
  • Loading branch information
davazp committed Nov 9, 2011
1 parent ac7cbe7 commit bbeaaa8
Show file tree
Hide file tree
Showing 34 changed files with 5,518 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
*~
*.o
*.d
eulex
BUILTIN-FILES.S
/eulexrc.fs
79 changes: 79 additions & 0 deletions GNUmakefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
# -*- makefile -*-
#

.PHONY: all clean dist.

KERNEL=eulex

all: $(KERNEL)

LINKER_SCRIPT = eulex.lds

CFLAGS = -fstrength-reduce -nostdinc -m32 -nostdlib -fno-builtin -nostartfiles -nodefaultlibs -I. -ggdb
ASFLAGS = $(CFLAGS) -I.
DEPEND_FLAGS=-MM
LDFLAGS=-Wl,-T$(LINKER_SCRIPT)
FORTH_SRC= \
core.fs \
exceptions.fs \
output.fs \
string.fs \
math.fs \
tools.fs \
disassem.fs \
structures.fs \
interpreter.fs \
kernel/multiboot.fs \
kernel/cpuid.fs \
kernel/video.fs \
kernel/console.fs \
kernel/interrupts.fs \
kernel/exceptions.fs \
kernel/irq.fs \
kernel/timer.fs \
kernel/keyboard.fs \
kernel/speaker.fs \
kernel/serial.fs \
tests/tests.fs \
tests/tsuite.fs \
tests/base.fs \
tests/strings.fs \
linedit.fs \
user.fs \
eulexrc.fs

ASM_SRC=boot.S forth.S

SOURCES=$(ASM_SRC)
HEADERS=multiboot.h

OBJS = $(ASM_SRC:.S=.o) $(FORTH_SRC:.fs=.o)

$(KERNEL): $(OBJS) $(LINKER_SCRIPT)
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^

clean:
-rm -f *.[do] $(KERNEL) BUILTIN-FILES.S

%.d: %.S GNUmakefile
@$(CC) $(DEPEND_FLAGS) $(CPPFLAGS) $< > $@.tmp; \
sed 's,\($*\)\.o[ :]*,\1.o $@ : ,g' < $@.tmp > $@; \
rm -f $@.tmp

%.o: %.fs
objcopy -I binary -O elf32-i386 -Bi386 $< $@

eulexrc.fs:
echo "( Write your personal definitions in this file )" > $@

forth.S: BUILTIN-FILES.S
BUILTIN-FILES.S: GNUmakefile
sh ./generate-builtin-files.sh $(FORTH_SRC)

dist:
git archive --format=tar --prefix=eulex/ HEAD | gzip > eulex.tar.gz


# ifneq ($(MAKECMDGOALS),clean)
# -include $(ASSEM_SRC:.S=.d)
# endif
66 changes: 66 additions & 0 deletions boot.S
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
/* boot.S - bootstrap the kernel */
/* Copyright (C) 1999, 2001 Free Software Foundation, Inc.
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., 675 Mass Ave, Cambridge, MA 02139, USA. */

#define ASM 1
#include "multiboot.h"

.section .text
.globl start, _start
start:
_start:
jmp multiboot_entry

/* Align 32 bits boundary. */
.align 4

/* Multiboot header. */
multiboot_header:
/* magic */
.long MULTIBOOT_HEADER_MAGIC
/* flags */
.long MULTIBOOT_HEADER_FLAGS
/* checksum */
.long -(MULTIBOOT_HEADER_MAGIC + MULTIBOOT_HEADER_FLAGS)
#ifndef __ELF__
/* header_addr */
.long multiboot_header
/* load_addr */
.long _start
/* load_end_addr */
.long _edata
/* bss_end_addr */
.long _end
/* entry_addr */
.long multiboot_entry
#endif /* ! __ELF__ */

multiboot_entry:
/* Initialize the stack pointer. */
movl $(stack + STACK_SIZE), %esp
/* Reset EFLAGS. */
pushl $0
popf
/* Now enter the C main function... */
call run_forth
loop: hlt
jmp loop

/* Our stack area. */
.comm stack, STACK_SIZE



Loading

0 comments on commit bbeaaa8

Please sign in to comment.