diff options
author | Alexis211 <alexis211@gmail.com> | 2009-12-18 16:27:29 +0100 |
---|---|---|
committer | Alexis211 <alexis211@gmail.com> | 2009-12-18 16:27:29 +0100 |
commit | 437e65ecbdedd07105254b1b5e6a41d191a794a3 (patch) | |
tree | 5c48afbd76c5cfc4c1297fc18acb0bc71cd502b3 /Source | |
parent | 260347c06637f15ea93c6ad99bce4420a28bae6b (diff) | |
download | Melon-437e65ecbdedd07105254b1b5e6a41d191a794a3.tar.gz Melon-437e65ecbdedd07105254b1b5e6a41d191a794a3.zip |
Revert "[nonworking commit] Started porting newlib"
This reverts commit d04645198d648a17ccb83e70aa5e6d60a06121aa.
Diffstat (limited to 'Source')
26 files changed, 3 insertions, 198 deletions
diff --git a/Source/Applications/Demos/Makefile b/Source/Applications/Demos/Makefile index 82489ba..e66acce 100644 --- a/Source/Applications/Demos/Makefile +++ b/Source/Applications/Demos/Makefile @@ -7,7 +7,7 @@ CXX = g++ CXXFLAGS = -nostartfiles -nostdlib -ffreestanding -fno-exceptions -fno-rtti -I ../../Library/Common -I ../../Library/Interface -I ../../Library/Userland -D THIS_IS_MELON_USERLAND LD = ld -LDFLAGS = -T ../../Library/App.ld -L ../../Library +LDFLAGS = -T ../../Library/Link.ld -L ../../Library Applications = asmdemo cxxdemo GOL diff --git a/Source/Applications/PaperWork/Makefile b/Source/Applications/PaperWork/Makefile index c39fc83..fe8d564 100644 --- a/Source/Applications/PaperWork/Makefile +++ b/Source/Applications/PaperWork/Makefile @@ -4,7 +4,7 @@ CXX = g++ CXXFLAGS = -nostartfiles -nostdlib -ffreestanding -fno-exceptions -fno-rtti -I ../../Library/Common -I ../../Library/Interface -I ../../Library/Userland -D THIS_IS_MELON_USERLAND LD = ld -LDFLAGS = -T ../../Library/App.ld -L ../../Library +LDFLAGS = -T ../../Library/Link.ld -L ../../Library Objects = main.o OutFile = PaperWork diff --git a/Source/Applications/Shell/Makefile b/Source/Applications/Shell/Makefile index a5587d8..bf81af6 100644 --- a/Source/Applications/Shell/Makefile +++ b/Source/Applications/Shell/Makefile @@ -4,7 +4,7 @@ CXX = g++ CXXFLAGS = -nostartfiles -nostdlib -ffreestanding -fno-exceptions -fno-rtti -I ../../Library/Common -I ../../Library/Interface -I ../../Library/Userland -D THIS_IS_MELON_USERLAND LD = ld -LDFLAGS = -T ../../Library/App.ld -L ../../Library +LDFLAGS = -T ../../Library/Link.ld -L ../../Library Objects = main.o \ Shell.ns.o \ diff --git a/Source/Library/App.ld b/Source/Library/Link.ld index 68591fd..68591fd 100644 --- a/Source/Library/App.ld +++ b/Source/Library/Link.ld diff --git a/Source/UnixUserland/App.ld b/Source/UnixUserland/App.ld deleted file mode 100644 index 03ac84f..0000000 --- a/Source/UnixUserland/App.ld +++ /dev/null @@ -1,33 +0,0 @@ -ENTRY (_start) -INPUT (MelonUnix.o) - -SECTIONS{ - . = 0x10000000; - - .text : { - *(.text) - } - - .rodata ALIGN (0x1000) :{ - *(.rodata) - } - - .data ALIGN (0x1000) : { - start_ctors = .; - *(.ctor*) - end_ctors = .; - start_dtors = .; - *(.dtor*) - end_dtors = .; - *(.data) - } - - .bss : { - sbss = .; - *(COMMON) - *(.bss) - ebss = .; - } - - end = .; _end = .; __end = .; -} diff --git a/Source/UnixUserland/Makefile b/Source/UnixUserland/Makefile deleted file mode 100644 index 44fa29f..0000000 --- a/Source/UnixUserland/Makefile +++ /dev/null @@ -1,50 +0,0 @@ -.PHONY: clean, mrproper - -CC = gcc -CCFLAGS = -nostdlib -nostartfiles -nodefaultlibs -fno-builtin -fno-stack-protector -Wall -Wextra -Werror -I../../Ports/newlib-1.15.0/newlib/libc/include - -LD = ld -LDFLAGS = -r - -OutFile = MelonUnix.o -Objects = _exit.o \ - _start.o \ - close.o \ - environ.o \ - execve.o \ - fork.o \ - fstat.o \ - getpid.o \ - isatty.o \ - kill.o \ - link.o \ - lseek.o \ - open.o \ - read.o \ - sbrk.o \ - stat.o \ - times.o \ - unlink.o \ - wait.o \ - write.o - -all: $(OutFile) - echo "* Done with $(OutFile)." - -rebuild: mrproper all - -$(OutFile): $(Objects) - echo "* Linking executable : $(OutFile)..." - $(LD) $(LDFLAGS) -o $(OutFile) $^ - -%.o: %.c - echo "* Compiling $<..." - $(CC) -c $< -o $@ $(CFLAGS) - -clean: - echo "* Removing object files..." - rm -rf $(Objects) - -mrproper: clean - echo "* Removing executable: $(OutFile)" - rm -rf $(OutFile) diff --git a/Source/UnixUserland/_exit.c b/Source/UnixUserland/_exit.c deleted file mode 100644 index 8753f0c..0000000 --- a/Source/UnixUserland/_exit.c +++ /dev/null @@ -1,2 +0,0 @@ -void _exit(int errcode) { -} diff --git a/Source/UnixUserland/_start.c b/Source/UnixUserland/_start.c deleted file mode 100644 index 00dc77e..0000000 --- a/Source/UnixUserland/_start.c +++ /dev/null @@ -1,7 +0,0 @@ -int main(); - -void _start() { - main(); - asm volatile("int $66;"); - while(1); -} diff --git a/Source/UnixUserland/close.c b/Source/UnixUserland/close.c deleted file mode 100644 index d1e0a16..0000000 --- a/Source/UnixUserland/close.c +++ /dev/null @@ -1,3 +0,0 @@ -int close(int file) { - return -1; -} diff --git a/Source/UnixUserland/environ.c b/Source/UnixUserland/environ.c deleted file mode 100644 index 7a59da1..0000000 --- a/Source/UnixUserland/environ.c +++ /dev/null @@ -1,2 +0,0 @@ -char *_env[1] = { 0 }; -char **environ = _env; diff --git a/Source/UnixUserland/execve.c b/Source/UnixUserland/execve.c deleted file mode 100644 index b066745..0000000 --- a/Source/UnixUserland/execve.c +++ /dev/null @@ -1,8 +0,0 @@ -#include <errno.h> -#undef errno -extern int errno; - -int execve(char *name, char **argv, char **env) { - errno = ENOMEM; - return -1; -} diff --git a/Source/UnixUserland/fork.c b/Source/UnixUserland/fork.c deleted file mode 100644 index 012bc17..0000000 --- a/Source/UnixUserland/fork.c +++ /dev/null @@ -1,8 +0,0 @@ -#include <errno.h> -#undef errno -extern int errno; - -int fork() { - errno = EAGAIN; - return -1; -} diff --git a/Source/UnixUserland/fstat.c b/Source/UnixUserland/fstat.c deleted file mode 100644 index 78d32f2..0000000 --- a/Source/UnixUserland/fstat.c +++ /dev/null @@ -1,6 +0,0 @@ -#include <sys/stat.h> - -int fstat(int file, struct stat *st) { - st->st_mode = S_IFCHR; - return 0; -} diff --git a/Source/UnixUserland/getpid.c b/Source/UnixUserland/getpid.c deleted file mode 100644 index c5e6884..0000000 --- a/Source/UnixUserland/getpid.c +++ /dev/null @@ -1,3 +0,0 @@ -int getpid() { - return 1; -} diff --git a/Source/UnixUserland/isatty.c b/Source/UnixUserland/isatty.c deleted file mode 100644 index 8a0d1e7..0000000 --- a/Source/UnixUserland/isatty.c +++ /dev/null @@ -1,3 +0,0 @@ -int isatty(int file) { - return 1; -} diff --git a/Source/UnixUserland/kill.c b/Source/UnixUserland/kill.c deleted file mode 100644 index c1f438b..0000000 --- a/Source/UnixUserland/kill.c +++ /dev/null @@ -1,8 +0,0 @@ -#include <errno.h> -#undef errno -extern int errno; - -int kill(int pid, int sig) { - errno = EINVAL; - return -1; -} diff --git a/Source/UnixUserland/link.c b/Source/UnixUserland/link.c deleted file mode 100644 index 17c08dd..0000000 --- a/Source/UnixUserland/link.c +++ /dev/null @@ -1,8 +0,0 @@ -#include <errno.h> -#undef errno -extern int errno; - -int link(char *old, char *new) { - errno = EMLINK; - return -1; -} diff --git a/Source/UnixUserland/lseek.c b/Source/UnixUserland/lseek.c deleted file mode 100644 index d3d24d8..0000000 --- a/Source/UnixUserland/lseek.c +++ /dev/null @@ -1,3 +0,0 @@ -int lseek(int file, int ptr, int dir) { - return 0; -} diff --git a/Source/UnixUserland/open.c b/Source/UnixUserland/open.c deleted file mode 100644 index eb9bed7..0000000 --- a/Source/UnixUserland/open.c +++ /dev/null @@ -1,3 +0,0 @@ -int open(const char* name, int flags, int mode) { - return -1; -} diff --git a/Source/UnixUserland/read.c b/Source/UnixUserland/read.c deleted file mode 100644 index 303c413..0000000 --- a/Source/UnixUserland/read.c +++ /dev/null @@ -1,3 +0,0 @@ -int read(int file, char *ptr, int len) { - return 0; -} diff --git a/Source/UnixUserland/sbrk.c b/Source/UnixUserland/sbrk.c deleted file mode 100644 index 26df466..0000000 --- a/Source/UnixUserland/sbrk.c +++ /dev/null @@ -1,16 +0,0 @@ -#include <sys/types.h> - -caddr_t sbrk(int incr) { - extern char end; - static char *heap_end; - char *prev_heap_end; - - if (heap_end == 0) { - heap_end = &end; - } - prev_heap_end = heap_end; - - heap_end += incr; - return (caddr_t) prev_heap_end; - -} diff --git a/Source/UnixUserland/stat.c b/Source/UnixUserland/stat.c deleted file mode 100644 index 1dada06..0000000 --- a/Source/UnixUserland/stat.c +++ /dev/null @@ -1,2 +0,0 @@ -#include <sys/stat.h> - diff --git a/Source/UnixUserland/times.c b/Source/UnixUserland/times.c deleted file mode 100644 index 39ebf29..0000000 --- a/Source/UnixUserland/times.c +++ /dev/null @@ -1 +0,0 @@ -#include <sys/times.h> diff --git a/Source/UnixUserland/unlink.c b/Source/UnixUserland/unlink.c deleted file mode 100644 index 112ca54..0000000 --- a/Source/UnixUserland/unlink.c +++ /dev/null @@ -1,8 +0,0 @@ -#include <errno.h> -#undef errno -extern int errno; - -int unlink(char *name) { - errno = ENOENT; - return -1; -} diff --git a/Source/UnixUserland/wait.c b/Source/UnixUserland/wait.c deleted file mode 100644 index 5073c77..0000000 --- a/Source/UnixUserland/wait.c +++ /dev/null @@ -1,8 +0,0 @@ -#include <errno.h> -#undef errno -extern int errno; - -int wait(int *status) { - errno = ECHILD; - return -1; -} diff --git a/Source/UnixUserland/write.c b/Source/UnixUserland/write.c deleted file mode 100644 index 3cd436b..0000000 --- a/Source/UnixUserland/write.c +++ /dev/null @@ -1,10 +0,0 @@ -int write(int file, char *ptr, int len) { - int i; - for (i = 0; i < len; i++) { - int t = ptr[i]; - asm volatile("mov $0xFFFFFF01, %%eax; \ - mov %0, %%ebx; \ - int $64;" : : "r"(t)); - } - return len; -} |