Chameleon

Chameleon Commit Details

Date:2011-05-27 04:38:41 (12 years 10 months ago)
Author:Evan Lojewski
Commit:891
Parents: 890
Message:Makefile update. Modules can now be compiled into chameleon. Modified some chameleon functions to follow the std c lib
Changes:
M/trunk/i386/libsaio/console.c
M/trunk/i386/boot2/graphics.c
M/trunk/i386/modules/klibc/Makefile
M/trunk/i386/libsa/libsa.h
M/trunk/i386/modules/uClibc++/Makefile
M/trunk/TODO
M/trunk/i386/libsa/printf.c
M/trunk/i386/Makefile
M/trunk/Make.rules
M/trunk/CHANGES
M/trunk/i386/libsa/string.c
M/trunk/i386/libsaio/biosfn.c
M/trunk/i386/modules/Makefile
M/trunk/i386/modules/Resolution/Makefile
M/trunk/i386/boot2/gui.c
M/trunk/i386/modules/MakeInc.dir
M/trunk/i386/libsaio/saio_internal.h
M/trunk/i386/modules/HelloWorld/Makefile
M/trunk/i386/modules/klibc/klibc.c
M/trunk/i386/boot2/options.c
M/trunk/i386/boot2/Makefile
M/trunk/i386/libsa/prf.c

File differences

trunk/i386/libsaio/console.c
7171
7272
7373
74
74
7575
7676
7777
7878
7979
80
80
8181
8282
83
8384
8485
8586
......
123124
124125
125126
126
127
127128
128129
129130
130
131
131
132
132133
133134
134135
135136
136
137
137138
138139
139
140
141
142
140143
141144
142145
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)
/*
* 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()
trunk/i386/libsaio/biosfn.c
446446
447447
448448
449
449
450450
451451
452452
return bb.eax.r.h;
}
void putc(int ch)
void bios_putchar(int ch)
{
bb.intno = 0x10;
bb.ebx.r.h = 0x00; /* background black */
trunk/i386/libsaio/saio_internal.h
4747
4848
4949
50
50
5151
5252
5353
......
9191
9292
9393
94
94
9595
9696
9797
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();
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, ...);
trunk/i386/boot2/graphics.c
12091209
12101210
12111211
1212
1213
1212
1213
12141214
12151215
12161216
......
12191219
12201220
12211221
1222
1223
1222
1223
12241224
12251225
12261226
{
currentIndicator = 0;
}
putc(indicator[currentIndicator++]);
putc('\b');
putchar(indicator[currentIndicator++]);
putchar('\b');
}
}
{
if ( getVideoMode() == VGA_TEXT_MODE )
{
putc(' ');
putc('\b');
putchar(' ');
putchar('\b');
}
}
trunk/i386/boot2/Makefile
77
88
99
10
11
1012
1113
1214
......
4143
4244
4345
44
46
4547
4648
4749
......
6163
6264
6365
64
6566
6667
6768
......
7677
7778
7879
79
80
81
80
81
82
8283
8384
8485
......
9293
9394
9495
95
96
9697
9798
9899
......
106107
107108
108109
109
110
110111
111112
112113
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
# 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
PATCH_ADDR = $(shell echo ${SYMBOL_ADDR}-${DATA_ADDR}+${DATA_OFFSET} | bc)
all: $(DIRS_NEEDED) boot
ifeq (${CONFIG_EMBED_THEME}, y)
endif
@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)
@$(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}
@$(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 \
trunk/i386/boot2/gui.c
10321032
10331033
10341034
1035
1035
10361036
10371037
10381038
10391039
10401040
1041
1041
10421042
10431043
1044
10441045
10451046
10461047
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, ...)
trunk/i386/boot2/options.c
14861486
14871487
14881488
1489
1489
14901490
14911491
14921492
default:
if (isxdigit(key & kASCIIKeyMask) && digitsI < 2) {
putc(key & kASCIIKeyMask);
putchar(key & kASCIIKeyMask);
digits[digitsI++] = key & kASCIIKeyMask;
} else {
// TODO: Beep or something
trunk/i386/modules/Resolution/Makefile
11
22
33
4
4
55
66
77
......
99
1010
1111
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
4912
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 =
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
trunk/i386/modules/MakeInc.dir
77
88
99
10
11
12
13
14
15
1016
1117
1218
13
14
15
16
19
1720
18
19
21
22
23
24
25
26
27
28
29
30
2031
32
33
2134
2235
2336
......
3043
3144
3245
46
47
48
49
50
51
52
53
54
55
56
3357
3458
3559
3660
3761
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
38100
39101
40102
41103
42104
43105
44
106
45107
46108
47109
......
75137
76138
77139
140
141
78142
143
144
145
146
147
148
149
79150
80
81
151
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 \
-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 \
.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
trunk/i386/modules/klibc/klibc.c
1212
1313
1414
15
15
1616
17
18
1719
1820
1921
{
}
void _exit()
void _exit(int status)
{
stop("exit() called\n");
while(1) halt(); // this is never reached
}
char __toupper(char c)
trunk/i386/modules/klibc/Makefile
11
22
33
4
4
55
66
77
......
1111
1212
1313
14
15
14
15
1616
1717
1818
......
2121
2222
2323
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
6424
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
__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 \
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
trunk/i386/modules/uClibc++/Makefile
11
2
2
33
44
5
5
66
77
88
......
1818
1919
2020
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
5821
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++
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
trunk/i386/modules/HelloWorld/Makefile
11
22
33
4
4
55
66
77
......
99
1010
1111
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
4312
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++
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
trunk/i386/modules/Makefile
1111
1212
1313
14
14
1515
1616
1717
......
2222
2323
2424
25
25
2626
2727
2828
......
3737
3838
3939
40
41
42
43
44
4045
4146
4247
4348
4449
50
51
52
4553
4654
4755
4856
49
57
58
59
60
61
62
63
64
65
66
67
68
include ${SRCROOT}/Make.rules
# The order of building is important.
SUBDIRS = klibc uClibc++ Resolution
SUBDIRS = klibc uClibc++ Resolution HelloWorld
CFLAGS= -O3 $(MORECPP) -arch i386 -g -static
ifeq (${CONFIG_MODULES}, y)
all install: $(SYMROOT) $(OBJROOT) objroot_dirs
all install: $(SYMROOT) $(OBJROOT) objroot_dirs $(SYMROOT)/boot_modules.c $(SYMROOT)/boot_modules.h
@for i in ${SUBDIRS}; \
do \
echo ================= make $@ for $$i =================; \
"RC_CFLAGS=$(RC_CFLAGS)" $@ \
) || exit $$?; \
done
@# Finish up boot_modules.c
@echo "}" >> $(SYMROOT)/boot_modules.c
else
all:
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/"
@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(); " > $@
trunk/i386/libsa/libsa.h
9898
9999
100100
101
101
102102
103103
104104
......
128128
129129
130130
131
131
132132
133133
134134
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);
/*
* 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);
/*
trunk/i386/libsa/printf.c
3333
3434
3535
36
36
3737
3838
3939
4040
4141
42
42
4343
4444
45
4546
4647
4748
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*/
trunk/i386/libsa/string.c
108108
109109
110110
111
111
112112
113113
114114
#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++;
trunk/i386/libsa/prf.c
9393
9494
9595
96
96
9797
9898
9999
void prf(
char *fmt,
unsigned int *adx,
void (*putfn_p)(),
int (*putfn_p)(),
void *putfn_arg
)
{
trunk/i386/Makefile
11
2
32
43
54
......
1514
1615
1716
18
19
20
2117
2218
2319
2420
21
2522
2623
2724
#Makefile for i386 boot program
#define FLOPPY and SMALL using DEFINES macro as necessary
#
# these paths are only valid in subdirectories of this directory
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 =================; \
trunk/TODO
11
22
3
43
54
65
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
trunk/Make.rules
8888
8989
9090
91
92
93
94
95
96
9197
9298
9399
-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] $<"
trunk/CHANGES
1
12
23
34
- 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.

Archive Download the corresponding diff file

Revision: 891