Index: branches/azimutz/Cleancut/i386/libsaio/console.c =================================================================== --- branches/azimutz/Cleancut/i386/libsaio/console.c (revision 893) +++ branches/azimutz/Cleancut/i386/libsaio/console.c (revision 894) @@ -71,15 +71,16 @@ char * last_str; }; -static void sputc(int c, struct putc_info * pi) +static int sputc(int c, struct putc_info * pi) { if (pi->last_str) if (pi->str == pi->last_str) { *(pi->str) = '\0'; - return; + return 0; } *(pi->str)++ = c; + return c; } void initBooterLog(void) @@ -123,20 +124,22 @@ /* * write one character to console */ -void putchar(int c) +int putchar(int c) { if ( c == '\t' ) { - for (c = 0; c < 8; c++) putc(' '); - return; + for (c = 0; c < 8; c++) bios_putchar(' '); + return c; } if ( c == '\n' ) { - putc('\r'); + bios_putchar('\r'); } - putc(c); + bios_putchar(c); + + return c; } int getc() Index: branches/azimutz/Cleancut/i386/libsaio/Makefile =================================================================== --- branches/azimutz/Cleancut/i386/libsaio/Makefile (revision 893) +++ branches/azimutz/Cleancut/i386/libsaio/Makefile (revision 894) @@ -23,7 +23,7 @@ -fno-builtin -static $(OMIT_FRAME_POINTER_CFLAG) \ -mpreferred-stack-boundary=2 -fno-align-functions -fno-stack-protector \ -march=pentium4 -msse2 -mfpmath=sse -msoft-float -nostdinc -include $(SRCROOT)/autoconf.h - + CPPFLAGS := $(CPPFLAGS) -nostdinc++ INC = -I. -I$(SYMROOT) -I$(LIBSADIR) -I$(BOOT2DIR) -I${SRCROOT}/i386/include @@ -56,7 +56,7 @@ @ar q $@ $^ &> /dev/null @echo "\t[RANLIB] $(@F)" @ranlib $(SYMROOT)/$(@F) - + # dependencies -include $(OBJROOT)/Makedep Index: branches/azimutz/Cleancut/i386/libsaio/pci_setup.c =================================================================== --- branches/azimutz/Cleancut/i386/libsaio/pci_setup.c (revision 893) +++ branches/azimutz/Cleancut/i386/libsaio/pci_setup.c (revision 894) @@ -16,16 +16,14 @@ { bool do_eth_devprop, do_enable_hpet; pci_dt_t *current = pci_dt; - + do_eth_devprop = do_enable_hpet = false; - + getBoolForKey(kEthernetBuiltIn, &do_eth_devprop, &bootInfo->bootConfig); getBoolForKey(kForceHPET, &do_enable_hpet, &bootInfo->bootConfig); while (current) { - execute_hook("PCIDevice", current, NULL, NULL, NULL); - switch (current->class_id) { case PCI_CLASS_BRIDGE_HOST: @@ -37,11 +35,11 @@ if (do_eth_devprop) set_eth_builtin(current); break; - + case PCI_CLASS_SERIAL_USB: notify_usb_dev(current); break; - + case PCI_CLASS_BRIDGE_ISA: if (do_enable_hpet) force_enable_hpet(current); Index: branches/azimutz/Cleancut/i386/libsaio/biosfn.c =================================================================== --- branches/azimutz/Cleancut/i386/libsaio/biosfn.c (revision 893) +++ branches/azimutz/Cleancut/i386/libsaio/biosfn.c (revision 894) @@ -446,7 +446,7 @@ return bb.eax.r.h; } -void putc(int ch) +void bios_putchar(int ch) { bb.intno = 0x10; bb.ebx.r.h = 0x00; /* background black */ Index: branches/azimutz/Cleancut/i386/libsaio/saio_internal.h =================================================================== --- branches/azimutz/Cleancut/i386/libsaio/saio_internal.h (revision 893) +++ branches/azimutz/Cleancut/i386/libsaio/saio_internal.h (revision 894) @@ -47,7 +47,7 @@ extern int ebioswrite(int dev, long sec, int count); extern int get_drive_info(int drive, struct driveInfo *dp); extern int ebiosEjectMedia(int biosdev); -extern void putc(int ch); +extern void bios_putchar(int ch); extern void putca(int ch, int attr, int repeat); extern int getc(void); extern void pause(); @@ -91,7 +91,7 @@ extern bool gErrors; extern void initBooterLog(void); extern void setupBooterLog(void); -extern void putchar(int ch); +extern int putchar(int ch); extern int getchar(void); extern void msglog(const char * format, ...); extern int printf(const char *format, ...); Index: branches/azimutz/Cleancut/i386/boot2/graphics.c =================================================================== --- branches/azimutz/Cleancut/i386/boot2/graphics.c (revision 893) +++ branches/azimutz/Cleancut/i386/boot2/graphics.c (revision 894) @@ -1209,8 +1209,8 @@ { currentIndicator = 0; } - putc(indicator[currentIndicator++]); - putc('\b'); + putchar(indicator[currentIndicator++]); + putchar('\b'); } } @@ -1219,8 +1219,8 @@ { if ( getVideoMode() == VGA_TEXT_MODE ) { - putc(' '); - putc('\b'); + putchar(' '); + putchar('\b'); } } Index: branches/azimutz/Cleancut/i386/boot2/Makefile =================================================================== --- branches/azimutz/Cleancut/i386/boot2/Makefile (revision 893) +++ branches/azimutz/Cleancut/i386/boot2/Makefile (revision 894) @@ -7,6 +7,8 @@ IMGSKELROOT = $(SRCROOT)/imgskel CDBOOT = ${IMGROOT}/usr/standalone/i386/cdboot +VPATH = $(SYMROOT) + # Makefile for i386 boot program # define FLOPPY and SMALL using DEFINES macro as necessary @@ -41,7 +43,7 @@ # The ordering is important; # boot2.o must be first. OBJS = boot2.o boot.o graphics.o drivers.o prompt.o options.o lzss.o mboot.o \ - ramdisk.o picopng.o resume.o bmdecompress.o graphic_utils.o gui.o modules.o modules_support.o + ramdisk.o picopng.o resume.o bmdecompress.o graphic_utils.o gui.o modules.o modules_support.o boot_modules.o # button.o browser.o scrollbar.o == NOTYET UTILDIR = ../util @@ -61,7 +63,6 @@ PATCH_ADDR = $(shell echo ${SYMBOL_ADDR}-${DATA_ADDR}+${DATA_OFFSET} | bc) - all: $(DIRS_NEEDED) boot ifeq (${CONFIG_EMBED_THEME}, y) @@ -75,10 +76,11 @@ endif + @${MKDIRS} $(OBJROOT)/../boot2_modules/ @echo "\t[LD] boot.sys" - @$(CC) -static -Wl,-preload -Wl,-segaddr,__INIT,$(BOOT2ADDR) \ - -nostdlib -arch i386 -Wl,-segalign,20 \ - -o $(SYMROOT)/boot.sys $(filter %.o,$^) $(LIBS) -lcc_kext + @$(CC) -Wl,-segaddr,__INIT,$(BOOT2ADDR) -Wl,-segalign,20 -Wl,-preload \ + -nostdlib -arch i386 -static \ + -o $(SYMROOT)/boot.sys $(filter %.o,$^) `find $(OBJROOT)/../boot2_modules/ -name \*.o` $(LIBS) -lcc_kext ifeq (${CONFIG_MODULES}, y) @@ -92,7 +94,7 @@ @$(CC) -static -Wl,-preload -Wl,-segaddr,__INIT,$(BOOT2ADDR) \ -nostdlib -arch i386 -Wl,-segalign,20 \ -Wl,-sectcreate,__DATA,__Symbols,$(SYMROOT)/Symbols.dylib \ - -o $(SYMROOT)/boot.sys $(filter %.o,$^) $(LIBS) -lcc_kext + -o $(SYMROOT)/boot.sys $(filter %.o,$^) `find $(OBJROOT)/../boot2_modules/ -name \*.o` $(LIBS) -lcc_kext @# Second pass, fixup global var locations @${RM} $(SYMROOT)/${SYMBOLS_MODULE} @@ -106,7 +108,7 @@ @$(CC) -static -Wl,-preload -Wl,-segaddr,__INIT,$(BOOT2ADDR) \ -nostdlib -arch i386 -Wl,-segalign,20 \ -Wl,-sectcreate,__DATA,__Symbols,$(SYMROOT)/Symbols.dylib \ - -o $(SYMROOT)/boot.sys $(filter %.o,$^) $(LIBS) -lcc_kext + -o $(SYMROOT)/boot.sys $(filter %.o,$^) `find $(OBJROOT)/../boot2_modules/ -name \*.o` $(LIBS) -lcc_kext @$(LD) -arch i386 \ -undefined dynamic_lookup \ Index: branches/azimutz/Cleancut/i386/boot2/modules.c =================================================================== --- branches/azimutz/Cleancut/i386/boot2/modules.c (revision 893) +++ branches/azimutz/Cleancut/i386/boot2/modules.c (revision 894) @@ -10,6 +10,7 @@ #include "boot.h" #include "bootstruct.h" #include "modules.h" +#include "boot_modules.h" #if CONFIG_MODULE_DEBUG @@ -40,6 +41,10 @@ */ int init_module_system() { + // Start any modules that were compiled in first. + start_built_in_modules(); + + int retVal = 0; void (*module_start)(void) = NULL; char* module_data = symbols_module_start + BOOT2_ADDR; Index: branches/azimutz/Cleancut/i386/boot2/gui.c =================================================================== --- branches/azimutz/Cleancut/i386/boot2/gui.c (revision 893) +++ branches/azimutz/Cleancut/i386/boot2/gui.c (revision 894) @@ -1032,15 +1032,16 @@ char * last_str; }; -static void +static int sputc(int c, struct putc_info * pi) { if (pi->last_str) if (pi->str == pi->last_str) { *(pi->str) = '\0'; - return; + return 0; } *(pi->str)++ = c; + return c; } int gprintf( window_t * window, const char * fmt, ...) Index: branches/azimutz/Cleancut/i386/boot2/options.c =================================================================== --- branches/azimutz/Cleancut/i386/boot2/options.c (revision 893) +++ branches/azimutz/Cleancut/i386/boot2/options.c (revision 894) @@ -1486,7 +1486,7 @@ default: if (isxdigit(key & kASCIIKeyMask) && digitsI < 2) { - putc(key & kASCIIKeyMask); + putchar(key & kASCIIKeyMask); digits[digitsI++] = key & kASCIIKeyMask; } else { // TODO: Beep or something Index: branches/azimutz/Cleancut/i386/config/Makefile =================================================================== --- branches/azimutz/Cleancut/i386/config/Makefile (revision 893) +++ branches/azimutz/Cleancut/i386/config/Makefile (revision 894) @@ -47,7 +47,7 @@ config: $(DIRS_NEEDED) $(SYMPROG) @cd ${SRCROOT} && $(SYMPROG) $(SRCROOT)/Cconfig - + rebuild_config: $(DIRS_NEEDED) $(SYMPROG) @cd ${SRCROOT} && $(SYMPROG) $(SRCROOT)/Cconfig rebuild Index: branches/azimutz/Cleancut/i386/modules/Resolution/Makefile =================================================================== --- branches/azimutz/Cleancut/i386/modules/Resolution/Makefile (revision 893) +++ branches/azimutz/Cleancut/i386/modules/Resolution/Makefile (revision 894) @@ -1,7 +1,7 @@ MODULE_NAME = Resolution MODULE_VERSION = "1.0.0" MODULE_COMPAT_VERSION = "1.0.0" -MODULE_START = _$(MODULE_NAME)_start +MODULE_START = $(MODULE_NAME)_start MODULE_DEPENDENCIES = @@ -9,41 +9,4 @@ MODULE_OBJS = Resolution.o edid.o 915resolution.o -OPTIM = -Os -Oz -DEBUG = -DNOTHING -#DEBUG = -DDEBUG_HELLO_WORLD=1 -CFLAGS = $(RC_CFLAGS) $(OPTIM) $(MORECPP) -arch i386 -g -Wmost \ - -D__ARCHITECTURE__=\"i386\" -DSAIO_INTERNAL_USER \ - -DRCZ_COMPRESSED_FILE_SUPPORT $(DEBUG) \ - -fno-builtin $(OMIT_FRAME_POINTER_CFLAG) \ - -mpreferred-stack-boundary=2 -fno-align-functions -fno-stack-protector \ - -march=pentium4 -msse2 -mfpmath=sse -msoft-float -fno-common - -DEFINES= -CONFIG = hd -INC = -I. -I.. -I$(SYMROOT) -I$(UTILDIR) -I$(LIBSADIR) -I$(LIBSAIODIR) -I$(BOOT2DIR) -ifneq "" "$(wildcard /bin/mkdirs)" - MKDIRS = /bin/mkdirs -else - MKDIRS = /bin/mkdir -p -endif -AS = as -LD = ld -# LIBS= -lc_static -LIBS= - -VPATH = $(OBJROOT):$(SYMROOT) - -SFILES = -CFILES = -HFILES = -EXPORTED_HFILES = -INSTALLED_HFILES = -OTHERFILES = Makefile -ALLSRC = $(SFILES) $(CFILES) \ - $(HFILES) $(OTHERFILES) -DIRS_NEEDED = $(OBJROOT) $(SYMROOT) - -all embedtheme optionrom: dylib - include ../MakeInc.dir \ No newline at end of file Index: branches/azimutz/Cleancut/i386/modules/MakeInc.dir =================================================================== --- branches/azimutz/Cleancut/i386/modules/MakeInc.dir (revision 893) +++ branches/azimutz/Cleancut/i386/modules/MakeInc.dir (revision 894) @@ -7,17 +7,30 @@ IMGSKELROOT = $(SRCROOT)/imgskel CDBOOT = ${IMGROOT}/usr/standalone/i386/cdboot + +ifeq ($(BUILT_IN),yes) +override OBJROOT = $(SRCROOT)/obj/i386/boot2_modules/$(DIR) +override SYMROOT = $(SRCROOT)/sym/i386/ +endif + include ${SRCROOT}/Make.rules -UTILDIR = ../../util -LIBSADIR = ../../libsa -LIBSAIODIR = ../../libsaio -BOOT2DIR = ../../boot2 +ifeq ($(BUILT_IN),yes) -INC = -I$(SRCROOT)/i386/modules/include/ -Iinclude/ -I$(SRCROOT)/i386/modules/module_includes/ -I$(SRCROOT)/i386/libsaio/ -I$(SRCROOT)/i386/libsa/ -I$(SRCROOT)/i386/include/ -I$(SRCROOT)/i386/boot2/ -DEFINES := -D__KLIBC__ $(DEFINES) +CFLAGS := $(RC_CFLAGS) $(OPTIM) $(MORECPP) -arch i386 -g -Wmost -Werror \ + -fno-builtin -DSAIO_INTERNAL_USER -static $(OMIT_FRAME_POINTER_CFLAG) \ + -mpreferred-stack-boundary=2 -fno-align-functions -fno-stack-protector \ + -march=pentium4 -msse2 -mfpmath=sse -msoft-float -nostdinc -include $(SRCROOT)/autoconf.h + +CPPFLAGS := $(CPPFLAGS) -arch i386 -static -nostdinc++ -Wmost -Werror \ + -fno-builtin -mpreferred-stack-boundary=2 \ + -fno-align-functions -fno-stack-protector \ + -march=pentium4 -msse2 -mfpmath=sse -msoft-float \ + -arch i386 -include $(SRCROOT)/autoconf.h +else + CFLAGS := $(CLFAGS) -nostdinc -Wmost -Werror \ -fno-builtin -mpreferred-stack-boundary=2 \ -fno-align-functions -fno-stack-protector \ @@ -30,18 +43,67 @@ -march=pentium4 -msse2 -mfpmath=sse -msoft-float \ -arch i386 -include $(SRCROOT)/autoconf.h +endif + + +UTILDIR = ../../util +LIBSADIR = ../../libsa +LIBSAIODIR = ../../libsaio +BOOT2DIR = ../../boot2 + +INC = -I$(SRCROOT)/i386/modules/include/ -Iinclude/ -I$(SRCROOT)/i386/modules/module_includes/ -I$(SRCROOT)/i386/libsaio/ -I$(SRCROOT)/i386/libsa/ -I$(SRCROOT)/i386/include/ -I$(SRCROOT)/i386/boot2/ +DEFINES := -D__KLIBC__ $(DEFINES) + MODULE_DEPENDENCIES := $(foreach x,$(MODULE_DEPENDENCIES),-weak_library $(SYMROOT)/modules/$(x).dylib) INSTALLDIR = $(DSTROOT)/System/Library/Frameworks/System.framework/Versions/B/PrivateHeaders/standalone +##$(error DEFINED AS $(MODULE_DEFINITION)) + +MODULE_DEFINITION := $(CONFIG_$(shell echo $(MODULE_NAME) | tr '[:lower:]' '[:upper:]')_MODULE) + + +ifeq ($(MODULE_DEFINITION),m) +ifneq ($(BUILT_IN),yes) + +# Make this as a *MODULE* +all: dylib + +else +# Module not selected to be compiled as a module +all: + +endif + +else + +ifeq ($(MODULE_DEFINITION),y) +ifeq ($(BUILT_IN),yes) + +# Make this *BUILT IN* +all: ${OBJROOT} ${SYMROOT}/modules/ ${OBJROOT} $(addprefix $(OBJROOT)/, ${MODULE_OBJS}) $(SYMROOT)/boot_modules.h $(SYMROOT)/boot_modules.c + +else +# Module not selected to be built in +all: + +endif +else + +# Don't compile this module +all: + +endif +endif + dylib: ${SYMROOT}/modules/ ${OBJROOT} $(addprefix $(OBJROOT)/, ${MODULE_OBJS}) $(SYMROOT)/modules/$(MODULE_NAME).dylib $(SYMROOT)/modules/$(MODULE_NAME).dylib: @echo "\t[LD] $(MODULE_NAME).dylib" @ld -arch i386 \ - -alias $(MODULE_START) start \ + -alias _$(MODULE_START) start \ -dylib -read_only_relocs suppress \ -S -x -Z -dead_strip_dylibs \ -no_uuid \ @@ -75,7 +137,15 @@ +.PHONY: $(SYMROOT)/boot_modules.h +.PHONY: $(SYMROOT)/boot_modules.c +$(SYMROOT)/boot_modules.c: + @echo "\t$(MODULE_START)(); // $(MODULE_NAME)" >> $@ + +$(SYMROOT)/boot_modules.h: + @echo "void $(MODULE_START)(); // $(MODULE_NAME)" >> $@ + + #dependencies -#-include $(OBJROOT)/Makedep - +-include $(OBJROOT)/Makedep \ No newline at end of file Index: branches/azimutz/Cleancut/i386/modules/NVIDIAGraphicsEnabler/Makefile =================================================================== --- branches/azimutz/Cleancut/i386/modules/NVIDIAGraphicsEnabler/Makefile (revision 893) +++ branches/azimutz/Cleancut/i386/modules/NVIDIAGraphicsEnabler/Makefile (revision 894) @@ -1,41 +1,11 @@ MODULE_NAME = NVIDIAGraphicsEnabler MODULE_VERSION = "1.0.0" MODULE_COMPAT_VERSION = "1.0.0" -MODULE_START = _$(MODULE_NAME)_start +MODULE_START = $(MODULE_NAME)_start MODULE_DEPENDENCIES = DIR = NVIDIAGraphicsEnabler MODULE_OBJS = nvidia.o NVIDIAGraphicsEnabler.o -OPTIM = -Os -Oz -DEBUG = -DNOTHING -#DEBUG = -DDEBUG_HELLO_WORLD=1 -CFLAGS = $(RC_CFLAGS) $(OPTIM) $(MORECPP) -arch i386 -g -Wmost \ - -D__ARCHITECTURE__=\"i386\" -DSAIO_INTERNAL_USER \ - -DRCZ_COMPRESSED_FILE_SUPPORT $(DEBUG) \ - -fno-builtin $(OMIT_FRAME_POINTER_CFLAG) \ - -mpreferred-stack-boundary=2 -fno-align-functions -fno-stack-protector \ - -march=pentium4 -msse2 -mfpmath=sse -msoft-float -fno-common - -DEFINES= -CONFIG = hd -INC = -I. -I.. -I$(SYMROOT) -I$(UTILDIR) -I$(LIBSADIR) -I$(LIBSAIODIR) -I$(BOOT2DIR) -LIBS= - -VPATH = $(OBJROOT):$(SYMROOT) - -SFILES = -CFILES = -HFILES = -EXPORTED_HFILES = -INSTALLED_HFILES = -OTHERFILES = Makefile -ALLSRC = $(SFILES) $(CFILES) \ - $(HFILES) $(OTHERFILES) -DIRS_NEEDED = $(OBJROOT) $(SYMROOT) - -all embedtheme optionrom: dylib - - include ../MakeInc.dir Index: branches/azimutz/Cleancut/i386/modules/klibc/klibc.c =================================================================== --- branches/azimutz/Cleancut/i386/modules/klibc/klibc.c (revision 893) +++ branches/azimutz/Cleancut/i386/modules/klibc/klibc.c (revision 894) @@ -12,8 +12,10 @@ { } -void _exit() +void _exit(int status) { + stop("exit() called\n"); + while(1) halt(); // this is never reached } char __toupper(char c) Index: branches/azimutz/Cleancut/i386/modules/klibc/Makefile =================================================================== --- branches/azimutz/Cleancut/i386/modules/klibc/Makefile (revision 893) +++ branches/azimutz/Cleancut/i386/modules/klibc/Makefile (revision 894) @@ -1,7 +1,7 @@ MODULE_NAME = klibc MODULE_VERSION = "1.5.20" MODULE_COMPAT_VERSION = "1.5.20" -MODULE_START = _$(MODULE_NAME)_start +MODULE_START = $(MODULE_NAME)_start MODULE_DEPENDENCIES = DIR = klibc @@ -11,8 +11,8 @@ __lshrdi3.o __moddi3.o __modsi3.o __udivdi3.o \ __udivmoddi4.o __udivmodsi4.o __udivsi3.o \ __umoddi3.o __umodsi3.o \ - strntoumax.o strntoimax.o atoi.o atol.o atoll.o \ - strcasecmp.o strncasecmp.o strdup.o strlcat.o strndup.o strnlen.o \ + strntoumax.o strntoimax.o atol.o atoll.o \ + strcasecmp.o strncasecmp.o strlcat.o strndup.o strnlen.o \ strsep.o strtoimax.o strtok_r.o strtok.o strtol.o strtoll.o strtotimespec.o strtotimeval.o \ strtoul.o strtoull.o strtoumax.o strxspn.o strpbrk.o \ bsearch.o calloc.o \ @@ -21,44 +21,4 @@ qsort.o sha1hash.o onexit.o atexit.o exit.o \ snprintf.o vsnprintf.o sscanf.o vsscanf.o\ -OPTIM = -Os -Oz -DEBUG = -DNOTHING -#DEBUG = -DDEBUG_HELLO_WORLD=1 -CFLAGS = $(RC_CFLAGS) $(OPTIM) $(MORECPP) -arch i386 -g -Wmost \ - -D__ARCHITECTURE__=\"i386\" -DSAIO_INTERNAL_USER \ - -DRCZ_COMPRESSED_FILE_SUPPORT $(DEBUG) \ - -fno-builtin $(OMIT_FRAME_POINTER_CFLAG) \ - -mpreferred-stack-boundary=2 -fno-align-functions -fno-stack-protector \ - -march=pentium4 -msse2 -mfpmath=sse -msoft-float -fno-common - -DEFINES= -CONFIG = hd -INC = -I. -I.. -I$(SYMROOT) -I$(UTILDIR) -I$(LIBSADIR) -I$(LIBSAIODIR) -I$(BOOT2DIR) -ifneq "" "$(wildcard /bin/mkdirs)" - MKDIRS = /bin/mkdirs -else - MKDIRS = /bin/mkdir -p -endif -AS = as -LD = ld -# LIBS= -lc_static -LIBS= - -VPATH = $(OBJROOT):$(SYMROOT) - - - - -SFILES = -CFILES = -HFILES = -EXPORTED_HFILES = -INSTALLED_HFILES = -OTHERFILES = Makefile -ALLSRC = $(SFILES) $(CFILES) \ - $(HFILES) $(OTHERFILES) -DIRS_NEEDED = $(OBJROOT) $(SYMROOT) - -all embedtheme optionrom: dylib - include ../MakeInc.dir \ No newline at end of file Index: branches/azimutz/Cleancut/i386/modules/IntelGraphicsEnabler/Makefile =================================================================== --- branches/azimutz/Cleancut/i386/modules/IntelGraphicsEnabler/Makefile (revision 893) +++ branches/azimutz/Cleancut/i386/modules/IntelGraphicsEnabler/Makefile (revision 894) @@ -1,41 +1,11 @@ MODULE_NAME = IntelGraphicsEnabler MODULE_VERSION = "1.0.0" MODULE_COMPAT_VERSION = "1.0.0" -MODULE_START = _$(MODULE_NAME)_start +MODULE_START = $(MODULE_NAME)_start MODULE_DEPENDENCIES = DIR = IntelGraphicsEnabler MODULE_OBJS = gma.o IntelGraphicsEnabler.o -OPTIM = -Os -Oz -DEBUG = -DNOTHING -#DEBUG = -DDEBUG_HELLO_WORLD=1 -CFLAGS = $(RC_CFLAGS) $(OPTIM) $(MORECPP) -arch i386 -g -Wmost \ - -D__ARCHITECTURE__=\"i386\" -DSAIO_INTERNAL_USER \ - -DRCZ_COMPRESSED_FILE_SUPPORT $(DEBUG) \ - -fno-builtin $(OMIT_FRAME_POINTER_CFLAG) \ - -mpreferred-stack-boundary=2 -fno-align-functions -fno-stack-protector \ - -march=pentium4 -msse2 -mfpmath=sse -msoft-float -fno-common - -DEFINES= -CONFIG = hd -INC = -I. -I.. -I$(SYMROOT) -I$(UTILDIR) -I$(LIBSADIR) -I$(LIBSAIODIR) -I$(BOOT2DIR) -LIBS= - -VPATH = $(OBJROOT):$(SYMROOT) - -SFILES = -CFILES = -HFILES = -EXPORTED_HFILES = -INSTALLED_HFILES = -OTHERFILES = Makefile -ALLSRC = $(SFILES) $(CFILES) \ - $(HFILES) $(OTHERFILES) -DIRS_NEEDED = $(OBJROOT) $(SYMROOT) - -all embedtheme optionrom: dylib - - include ../MakeInc.dir Index: branches/azimutz/Cleancut/i386/modules/ATiGraphicsEnabler/Makefile =================================================================== --- branches/azimutz/Cleancut/i386/modules/ATiGraphicsEnabler/Makefile (revision 893) +++ branches/azimutz/Cleancut/i386/modules/ATiGraphicsEnabler/Makefile (revision 894) @@ -1,41 +1,11 @@ MODULE_NAME = ATiGraphicsEnabler MODULE_VERSION = "1.0.0" MODULE_COMPAT_VERSION = "1.0.0" -MODULE_START = _$(MODULE_NAME)_start +MODULE_START = $(MODULE_NAME)_start MODULE_DEPENDENCIES = DIR = ATiGraphicsEnabler MODULE_OBJS = ati.o ATiGraphicsEnabler.o -OPTIM = -Os -Oz -DEBUG = -DNOTHING -#DEBUG = -DDEBUG_HELLO_WORLD=1 -CFLAGS = $(RC_CFLAGS) $(OPTIM) $(MORECPP) -arch i386 -g -Wmost \ - -D__ARCHITECTURE__=\"i386\" -DSAIO_INTERNAL_USER \ - -DRCZ_COMPRESSED_FILE_SUPPORT $(DEBUG) \ - -fno-builtin $(OMIT_FRAME_POINTER_CFLAG) \ - -mpreferred-stack-boundary=2 -fno-align-functions -fno-stack-protector \ - -march=pentium4 -msse2 -mfpmath=sse -msoft-float -fno-common - -DEFINES= -CONFIG = hd -INC = -I. -I.. -I$(SYMROOT) -I$(UTILDIR) -I$(LIBSADIR) -I$(LIBSAIODIR) -I$(BOOT2DIR) -LIBS= - -VPATH = $(OBJROOT):$(SYMROOT) - -SFILES = -CFILES = -HFILES = -EXPORTED_HFILES = -INSTALLED_HFILES = -OTHERFILES = Makefile -ALLSRC = $(SFILES) $(CFILES) \ - $(HFILES) $(OTHERFILES) -DIRS_NEEDED = $(OBJROOT) $(SYMROOT) - -all embedtheme: dylib - - include ../MakeInc.dir Index: branches/azimutz/Cleancut/i386/modules/uClibc++/Makefile =================================================================== --- branches/azimutz/Cleancut/i386/modules/uClibc++/Makefile (revision 893) +++ branches/azimutz/Cleancut/i386/modules/uClibc++/Makefile (revision 894) @@ -1,8 +1,8 @@ -MODULE_NAME = uClibc++ +MODULE_NAME = uClibcxx MODULE_VERSION = "0.2.2" MODULE_COMPAT_VERSION = "0.2.2" -MODULE_START = _uClibcxx_start +MODULE_START = $(MODULE_NAME)_start MODULE_DEPENDENCIES = klibc DIR = uClibc++ @@ -18,41 +18,4 @@ utility.o valarray.o vector.o support.o \ ios.o iostream.o istream.o ostream.o -OPTIM = -Os -Oz -DEBUG = -DNOTHING -#DEBUG = -DDEBUG_HELLO_WORLD=1 -CFLAGS = $(RC_CFLAGS) $(OPTIM) $(MORECPP) -arch i386 -g -Wmost \ - -D__ARCHITECTURE__=\"i386\" -DSAIO_INTERNAL_USER \ - -DRCZ_COMPRESSED_FILE_SUPPORT $(DEBUG) \ - -fno-builtin $(OMIT_FRAME_POINTER_CFLAG) \ - -mpreferred-stack-boundary=2 -fno-align-functions -fno-stack-protector \ - -march=pentium4 -msse2 -mfpmath=sse -msoft-float -fno-common - -DEFINES= -CONFIG = hd -INC = -I. -I.. -I$(SYMROOT) -I$(UTILDIR) -I$(LIBSADIR) -I$(LIBSAIODIR) -I$(BOOT2DIR) -Iinclude -ifneq "" "$(wildcard /bin/mkdirs)" - MKDIRS = /bin/mkdirs -else - MKDIRS = /bin/mkdir -p -endif -AS = as -LD = ld -# LIBS= -lc_static -LIBS= - -VPATH = $(OBJROOT):$(SYMROOT) - -SFILES = -CFILES = -HFILES = -EXPORTED_HFILES = -INSTALLED_HFILES = -OTHERFILES = Makefile -ALLSRC = $(SFILES) $(CFILES) \ - $(HFILES) $(OTHERFILES) -DIRS_NEEDED = $(OBJROOT) $(SYMROOT) - -all embedtheme optionrom: dylib - include ../MakeInc.dir \ No newline at end of file Index: branches/azimutz/Cleancut/i386/modules/AMDGraphicsEnabler/Makefile =================================================================== --- branches/azimutz/Cleancut/i386/modules/AMDGraphicsEnabler/Makefile (revision 893) +++ branches/azimutz/Cleancut/i386/modules/AMDGraphicsEnabler/Makefile (revision 894) @@ -1,41 +1,11 @@ MODULE_NAME = AMDGraphicsEnabler MODULE_VERSION = "1.0.0" MODULE_COMPAT_VERSION = "1.0.0" -MODULE_START = _$(MODULE_NAME)_start +MODULE_START = $(MODULE_NAME)_start MODULE_DEPENDENCIES = DIR = AMDGraphicsEnabler MODULE_OBJS = ati.o AMDGraphicsEnabler.o -OPTIM = -Os -Oz -DEBUG = -DNOTHING -#DEBUG = -DDEBUG_HELLO_WORLD=1 -CFLAGS = $(RC_CFLAGS) $(OPTIM) $(MORECPP) -arch i386 -g -Wmost \ - -D__ARCHITECTURE__=\"i386\" -DSAIO_INTERNAL_USER \ - -DRCZ_COMPRESSED_FILE_SUPPORT $(DEBUG) \ - -fno-builtin $(OMIT_FRAME_POINTER_CFLAG) \ - -mpreferred-stack-boundary=2 -fno-align-functions -fno-stack-protector \ - -march=pentium4 -msse2 -mfpmath=sse -msoft-float -fno-common - -DEFINES= -CONFIG = hd -INC = -I. -I.. -I$(SYMROOT) -I$(UTILDIR) -I$(LIBSADIR) -I$(LIBSAIODIR) -I$(BOOT2DIR) -LIBS= - -VPATH = $(OBJROOT):$(SYMROOT) - -SFILES = -CFILES = -HFILES = -EXPORTED_HFILES = -INSTALLED_HFILES = -OTHERFILES = Makefile -ALLSRC = $(SFILES) $(CFILES) \ - $(HFILES) $(OTHERFILES) -DIRS_NEEDED = $(OBJROOT) $(SYMROOT) - -all embedtheme optionrom: dylib - - include ../MakeInc.dir Index: branches/azimutz/Cleancut/i386/modules/HelloWorld/Makefile =================================================================== --- branches/azimutz/Cleancut/i386/modules/HelloWorld/Makefile (revision 893) +++ branches/azimutz/Cleancut/i386/modules/HelloWorld/Makefile (revision 894) @@ -1,7 +1,7 @@ MODULE_NAME = HelloWorld MODULE_VERSION = "1.0.0" MODULE_COMPAT_VERSION = "1.0.0" -#MODULE_START = _$(MODULE_NAME)_start +#MODULE_START = $(MODULE_NAME)_start MODULE_START = __Z16HelloWorld_startv MODULE_DEPENDENCIES = uClibc++ @@ -9,35 +9,4 @@ MODULE_OBJS = HelloWorld.o -OPTIM = -Os -Oz -DEBUG = -DNOTHING -#DEBUG = -DDEBUG_HELLO_WORLD=1 -CFLAGS = $(RC_CFLAGS) $(OPTIM) $(MORECPP) -arch i386 -g -Wmost \ - -D__ARCHITECTURE__=\"i386\" -DSAIO_INTERNAL_USER \ - -DRCZ_COMPRESSED_FILE_SUPPORT $(DEBUG) \ - -fno-builtin $(OMIT_FRAME_POINTER_CFLAG) \ - -mpreferred-stack-boundary=2 -fno-align-functions -fno-stack-protector \ - -march=pentium4 -msse2 -mfpmath=sse -msoft-float -fno-common - -DEFINES= -CONFIG = hd -INC = -I. -I.. -I$(SYMROOT) -I$(UTILDIR) -I$(LIBSADIR) -I$(LIBSAIODIR) -I$(BOOT2DIR) -LIBS= - -VPATH = $(OBJROOT):$(SYMROOT) - - - -SFILES = -CFILES = -HFILES = -EXPORTED_HFILES = -INSTALLED_HFILES = -OTHERFILES = Makefile -ALLSRC = $(SFILES) $(CFILES) \ - $(HFILES) $(OTHERFILES) -DIRS_NEEDED = $(OBJROOT) $(SYMROOT) - -all embedtheme optionrom: dylib - include ../MakeInc.dir \ No newline at end of file Index: branches/azimutz/Cleancut/i386/modules/Makefile =================================================================== --- branches/azimutz/Cleancut/i386/modules/Makefile (revision 893) +++ branches/azimutz/Cleancut/i386/modules/Makefile (revision 894) @@ -11,7 +11,7 @@ include ${SRCROOT}/Make.rules # The order of building is important. -SUBDIRS = klibc uClibc++ Resolution \ +SUBDIRS = klibc uClibc++ Resolution HelloWorld \ ATiGraphicsEnabler AMDGraphicsEnabler NVIDIAGraphicsEnabler IntelGraphicsEnabler @@ -23,7 +23,7 @@ ifeq (${CONFIG_MODULES}, y) -all install: $(SYMROOT) $(OBJROOT) objroot_dirs +all: $(SYMROOT) $(OBJROOT) objroot_dirs $(SYMROOT)/boot_modules.c $(SYMROOT)/boot_modules.h @for i in ${SUBDIRS}; \ do \ echo ================= make $@ for $$i =================; \ @@ -38,13 +38,35 @@ "RC_CFLAGS=$(RC_CFLAGS)" $@ \ ) || exit $$?; \ done + + @# Finish up boot_modules.c + @echo "}" >> $(SYMROOT)/boot_modules.c + + else -all: +all: $(SYMROOT) $(OBJROOT) objroot_dirs $(SYMROOT)/boot_modules.c $(SYMROOT)/boot_modules.h + @# Finish up boot_modules.c + @echo "}" >> $(SYMROOT)/boot_modules.c + endif .PHONY: objroot_dirs +.PHONY: $(SYMROOT)/boot_modules.h +.PHONY: $(SYMROOT)/boot_modules.c + objroot_dirs: @rm -rf module_includes @mkdir module_includes @rm -rf "$(SYMROOT)/modules/" - @mkdir "$(SYMROOT)/modules/" \ No newline at end of file + @mkdir "$(SYMROOT)/modules/" + + +$(SYMROOT)/boot_modules.c: ${OBJROOT} ${SYMROOT}/modules/ ${OBJROOT} $(addprefix $(OBJROOT)/, ${MODULE_OBJS}) + @echo "// Autogenerated - do not modify" > $@ + @echo "#include \"boot_modules.h\"" >> $@ + @echo "void start_built_in_modules() {" >> $@ + +$(SYMROOT)/boot_modules.h: ${OBJROOT} ${SYMROOT}/modules/ ${OBJROOT} $(addprefix $(OBJROOT)/, ${MODULE_OBJS}) + @echo "// Autogenerated - do not modify" > $@ + @echo "void start_built_in_modules(); " > $@ + Index: branches/azimutz/Cleancut/i386/cdboot/Makefile =================================================================== --- branches/azimutz/Cleancut/i386/cdboot/Makefile (revision 893) +++ branches/azimutz/Cleancut/i386/cdboot/Makefile (revision 894) @@ -6,7 +6,7 @@ IMGROOT = $(SRCROOT)/sym/cache IMGSKELROOT = $(SRCROOT)/imgskel CDBOOT = ${IMGROOT}/usr/standalone/i386/cdboot - + DIR = cdboot include ${SRCROOT}/Make.rules Index: branches/azimutz/Cleancut/i386/libsa/libsa.h =================================================================== --- branches/azimutz/Cleancut/i386/libsa/libsa.h (revision 893) +++ branches/azimutz/Cleancut/i386/libsa/libsa.h (revision 894) @@ -98,7 +98,7 @@ extern char * strstr(const char *in, const char *str); extern int atoi(const char * str); extern int ptol(const char * str); -extern int strlen(const char * str); +extern size_t strlen(const char * str); extern char * strcat(char * s1, const char * s2); extern char * strncat(char * s1, const char * s2, size_t n); extern char * strdup(const char *s1); @@ -128,7 +128,7 @@ /* * prf.c */ -extern void prf(const char * fmt, va_list ap, void (*putfn_p)(), +extern void prf(const char * fmt, va_list ap, int (*putfn_p)(), void * putfn_arg); /* Index: branches/azimutz/Cleancut/i386/libsa/printf.c =================================================================== --- branches/azimutz/Cleancut/i386/libsa/printf.c (revision 893) +++ branches/azimutz/Cleancut/i386/libsa/printf.c (revision 894) @@ -33,15 +33,16 @@ char * last_str; }; -static void +static int sputc(int c, struct putc_info * pi) { if (pi->last_str) if (pi->str == pi->last_str) { *(pi->str) = '\0'; - return; + return 0; } *(pi->str)++ = c; + return c; } /*VARARGS1*/ Index: branches/azimutz/Cleancut/i386/libsa/string.c =================================================================== --- branches/azimutz/Cleancut/i386/libsa/string.c (revision 893) +++ branches/azimutz/Cleancut/i386/libsa/string.c (revision 894) @@ -108,7 +108,7 @@ #define tolower(c) ((int)((c) & ~0x20)) #define toupper(c) ((int)((c) | 0x20)) -int strlen(const char * s) +size_t strlen(const char * s) { int n = 0; while (*s++) n++; Index: branches/azimutz/Cleancut/i386/libsa/prf.c =================================================================== --- branches/azimutz/Cleancut/i386/libsa/prf.c (revision 893) +++ branches/azimutz/Cleancut/i386/libsa/prf.c (revision 894) @@ -60,7 +60,7 @@ printn(n, b, flag, minwidth, putfn_p, putfn_arg) u_long n; int b, flag, minwidth; - void (*putfn_p)(); + int (*putfn_p)(); void *putfn_arg; { char prbuf[11]; @@ -93,7 +93,7 @@ void prf( char *fmt, unsigned int *adx, - void (*putfn_p)(), + int (*putfn_p)(), void *putfn_arg ) { Index: branches/azimutz/Cleancut/i386/libsa/Makefile =================================================================== --- branches/azimutz/Cleancut/i386/libsa/Makefile (revision 893) +++ branches/azimutz/Cleancut/i386/libsa/Makefile (revision 894) @@ -17,7 +17,7 @@ -mpreferred-stack-boundary=2 -fno-align-functions -fno-stack-protector \ -march=pentium4 -msse2 -mfpmath=sse -msoft-float \ -nostdinc -include $(SRCROOT)/autoconf.h - + CPPFLAGS := $(CPPFLAGS) -nostdinc++ INC = -I. -I$(SYMROOT) -I$(LIBSAIODIR) -I${SRCROOT}/i386/include Index: branches/azimutz/Cleancut/i386/Makefile =================================================================== --- branches/azimutz/Cleancut/i386/Makefile (revision 893) +++ branches/azimutz/Cleancut/i386/Makefile (revision 894) @@ -1,5 +1,4 @@ # Makefile for i386 boot program -# define FLOPPY and SMALL using DEFINES macro as necessary # # these paths are only valid in subdirectories of this directory @@ -15,13 +14,11 @@ include ${SRCROOT}/Make.rules - -VPATH = $(OBJROOT):$(SYMROOT) - # The order of building is important. SUBDIRS = util libsa libsaio boot0 boot1 boot2 cdboot modules all: + @cd modules; ${MAKE} BUILT_IN=yes all @for i in ${SUBDIRS}; \ do \ echo ================= make $@ for $$i =================; \ Index: branches/azimutz/Cleancut/TODO =================================================================== --- branches/azimutz/Cleancut/TODO (revision 893) +++ branches/azimutz/Cleancut/TODO (revision 894) @@ -1,6 +1,5 @@ TODO List for Chameleon Boot Loader ==================================== -- Setup makefile to use module config for determining which modules to compile in and which to compile as modules - Fix the module system when booting chameleon with multiboot. Cleanup the xcode 4 fix. - Integrate Prasys current work on options and quick shortcut modified version of 18seven Index: branches/azimutz/Cleancut/Make.rules =================================================================== --- branches/azimutz/Cleancut/Make.rules (revision 893) +++ branches/azimutz/Cleancut/Make.rules (revision 894) @@ -88,6 +88,12 @@ -MD -dependency-file $*.d @md -u $(OBJROOT)/Makedep -f -d $*.d +#$(OBJROOT)/boot_modules.o: +# @echo "\t[AS] boot_modules.s" +# @cc $(CPPFLAGS) -Wa,-n -c $(INC) -arch i386 -o $(OBJROOT)/$(@F) $(SYMROOT)/boot_modules.s \ +# -MD -dependency-file $*.d +# @md -u $(OBJROOT)/Makedep -f -d $*.d + $(OBJROOT)/%.o: %.s @echo "\t[AS] $<" Index: branches/azimutz/Cleancut/CHANGES =================================================================== --- branches/azimutz/Cleancut/CHANGES (revision 893) +++ branches/azimutz/Cleancut/CHANGES (revision 894) @@ -1,3 +1,4 @@ +- Modules can now be selected between not compiled, compiled into chameleon, or compiled as modules. - New makefile + configuration system. - Added the BOOT2_MAX_LENGTH constant in memory.h. This is now used in mboot.c to relocate the correct number of bytes for boot2. - Added new ATi/AMD Graphics Card Enabler. Index: branches/azimutz/Cleancut/Makefile =================================================================== --- branches/azimutz/Cleancut/Makefile (revision 893) +++ branches/azimutz/Cleancut/Makefile (revision 894) @@ -48,8 +48,8 @@ "JAPANESE=$(JAPANESE)" \ "RC_CFLAGS=$$XCFLAGS" $@ \ ) || exit $$?; \ - + all: $(SYMROOT) $(OBJROOT) $(SRCROOT)/auto.conf $(SRCROOT)/autoconf.h $(SRCROOT)/autoconf.inc $(SRCROOT)/.config @if [ -e ".svn" ]; then svnversion -n | tr -d [:alpha:] > revision; fi @if [ -z "$(RC_ARCHS)" ]; then \ Property changes on: branches/azimutz/Cleancut ___________________________________________________________________ Modified: svn:mergeinfo Merged /trunk:r890-893