Skip to content

Commit

Permalink
everything compiles now, still need to fix inline assembly
Browse files Browse the repository at this point in the history
  • Loading branch information
npe9 committed Jun 2, 2017
1 parent 86aece9 commit c9e5fcd
Show file tree
Hide file tree
Showing 11 changed files with 26 additions and 24 deletions.
2 changes: 1 addition & 1 deletion examples/x86/GNUmakerules
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ hello_p: $(OBJDIR)/lib/multiboot.o hello.po $(DEPENDLIBS)
$(CLIB_P) $(OBJDIR)/lib/crtn.o

# XXX requires -lgcc for long long ops
LIBGCC := `$(CC) --print-libgcc-file-name`
LIBGCC := `$(CC) -m32 --print-libgcc-file-name`
memtest: $(OBJDIR)/lib/multiboot.o tiny_stack.o direct_console.o memtest.o \
$(DEPENDLIBS)
$(OSKIT_QUIET_MAKE_INFORM) "Linking example $@"
Expand Down
4 changes: 2 additions & 2 deletions examples/x86/more/fsbmodmount.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,10 @@
#include <oskit/startup.h>

#define CHECK(x) { if (-1 == (x)) { perror(#x); \
printf(__FILE__":%d in "__FUNCTION__"\n", __LINE__); } }
printf("%s:%d in %s\n", __FILE__, __FUNCTION__, __LINE__); } }

#define CHECK0(x) { if (0 == (x)) { perror(#x); \
printf(__FILE__":%d in "__FUNCTION__"\n", __LINE__); } }
printf("%s:%d in %s\n", __FILE__, __FUNCTION__, __LINE__); } }

/*
* open and read a file and write its content to fd #1
Expand Down
5 changes: 3 additions & 2 deletions examples/x86/more/memtest.c
Original file line number Diff line number Diff line change
Expand Up @@ -199,13 +199,14 @@ main()
#define real_main main
#endif

static void drain_lmm(void);

int
real_main(int argc, char **argv)
{
size_t size;

#ifdef OSKIT
static void drain_lmm(void);
drain_lmm();
#endif
parse_args(argc, argv);
Expand Down Expand Up @@ -236,7 +237,7 @@ real_main(int argc, char **argv)
* This will force either a panic, or a call to morecore when an attempt
* to allocate memory is made.
*/
static void
void
drain_lmm(void)
{
extern oskit_addr_t phys_mem_max;
Expand Down
2 changes: 1 addition & 1 deletion examples/x86/more/netbsd_fs_posix.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ int main(int argc, char **argv)
int fd, i;

#define CHECK(x) { if (-1 == (x)) { perror(#x); \
printf(__FILE__":%d in "__FUNCTION__"\n", __LINE__); exit(-1); } }
printf("%s:%d in %s\n", __FILE__, __FUNCTION__, __LINE__); exit(-1); } }

#ifndef KNIT
if ((option = getenv("DISK")) != NULL)
Expand Down
2 changes: 1 addition & 1 deletion examples/x86/more/select.c
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ static char *getnamebyaddr(long addr) /* in network order !!! */
}

#define CHECK(x) { if (-1 == (x)) { perror(#x); \
printf(__FILE__":%d in "__FUNCTION__"\n", __LINE__); exit(-1); } }
printf("%s:%d in %s\n", __FILE__, __FUNCTION__, __LINE__); exit(-1); } }

#define N 32

Expand Down
4 changes: 2 additions & 2 deletions examples/x86/osenv_memdebug.c
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@ mem_release(oskit_osenv_mem_t *m0)

mem = m->mem;
oskit_osenv_mem_free(mem, m, 0, sizeof *m);
osenv_log(OSENV_LOG_INFO, __FUNCTION__": %d outstanding bytes\n",
m->outstanding);
osenv_log(OSENV_LOG_INFO, "%s: %d outstanding bytes\n",
__FUNCTION__, m->outstanding);
oskit_osenv_mem_release(mem);
return 0;
}
Expand Down
2 changes: 1 addition & 1 deletion examples/x86/shared/direct_console.c
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ trygetchar(void)
*/
static void our_exit(int rc)
{
printf(__FUNCTION__"(%d) called; rebooting...\n", rc);
printf("%s(%d) called; rebooting...\n", __FUNCTION__, rc);

/* This is so that the user has a chance to SEE the output */
printf("Press a key to reboot");
Expand Down
16 changes: 8 additions & 8 deletions examples/x86/shared/dols.c
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ dols(char *name, int lslong)
{
struct stat stbuf;
#if VERBOSITY > 1
printf(__FUNCTION__"(`%s',%d) called\n", name, lslong);
printf("%s(`%s',%d) called\n", __FUNCTION__, name, lslong);
#endif
lstat(name, &stbuf);

Expand All @@ -110,14 +110,14 @@ dols(char *name, int lslong)

if (thisdir == -1) {
perror("open .");
printf(__FUNCTION__": couldn't open current dir, "
"errno = x%x\n", errno);
printf("%s: couldn't open current dir, "
"errno = x%x\n", __FUNCTION__, errno);
return;
}

if (-1 == chdir(name)) {
perror(name);
printf(__FUNCTION__": chdir(`%s') failed\n", name);
printf("%s: chdir(`%s') failed\n", __FUNCTION__, name);
return;
}

Expand All @@ -133,8 +133,8 @@ dols(char *name, int lslong)
while ((de = readdir(fd)) != 0) {
if (-1 == lstat(de->d_name, &stbuf)) {
perror("lstat");
printf(__FUNCTION__": lstat(`%s') failed\n",
de->d_name);
printf("%s: lstat(`%s') failed\n",
__FUNCTION__, de->d_name);
return;
}
if (lslong)
Expand All @@ -151,8 +151,8 @@ dols(char *name, int lslong)

if (-1 == lstat(de->d_name, &stbuf)) {
perror("lstat");
printf(__FUNCTION__": stat de->d_name=`%s' "
"failed\n", de->d_name);
printf("%s: stat de->d_name=`%s' "
"failed\n", __FUNCTION__, de->d_name);
break;
}
if (S_ISDIR(stbuf.st_mode)) {
Expand Down
10 changes: 5 additions & 5 deletions examples/x86/sproc/GNUmakerules
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ CLIB_P = -loskit_freebsd_c_r_p -loskit_com_p -loskit_threads_p -loskit_gprof \

kernel: $(OBJDIR)/lib/multiboot.o kernel.o kern_syscall.o $(DEPENDLIBS)
$(OSKIT_QUIET_MAKE_INFORM) "Linking example $@"
$(LD) -Ttext 100000 $(LDFLAGS) $(OSKIT_LDFLAGS) \
$(LD) -melf_i386 -Ttext 100000 $(LDFLAGS) $(OSKIT_LDFLAGS) \
-o $@ $(filter-out %.a,$^) \
-loskit_startup -loskit_fsnamespace \
-loskit_memfs -loskit_sproc \
Expand All @@ -62,7 +62,7 @@ kernel: $(OBJDIR)/lib/multiboot.o kernel.o kern_syscall.o $(DEPENDLIBS)

kernel_p.gdb: $(OBJDIR)/lib/multiboot.o kernel.po kern_syscall.po $(DEPENDLIBS)
$(OSKIT_QUIET_MAKE_INFORM) "Linking example $@"
$(LD) -Ttext 100000 $(LDFLAGS) $(OSKIT_LDFLAGS) \
$(LD) -melf_i386 -Ttext 100000 $(LDFLAGS) $(OSKIT_LDFLAGS) \
-o $@ $(filter-out %.a,$^) \
-loskit_startup_p -loskit_fsnamespace_p \
-loskit_memfs_p -loskit_sproc_p \
Expand All @@ -83,17 +83,17 @@ USER_CRT = user_crt.o
USER_OBJS = user_syscall.o user_mem.o user_morecore.o

usermain_testsproc: $(USER_CRT) usermain_testsproc.o $(USER_OBJS)
$(CC) -nostdlib -static $(USER_CRT) usermain_testsproc.o $(USER_OBJS) \
$(CC) -m32 -march=i386 -nostdlib -static $(USER_CRT) usermain_testsproc.o $(USER_OBJS) \
-o $@ -Xlinker -Ttext -Xlinker 40000000 \
-L../../../lib -loskit_c -loskit_lmm

usermain_hello: $(USER_CRT) usermain_hello.o $(USER_OBJS)
$(CC) -nostdlib -static $(USER_CRT) usermain_hello.o $(USER_OBJS) \
$(CC) -m32 -march=i386 -nostdlib -static $(USER_CRT) usermain_hello.o $(USER_OBJS) \
-o $@ -Xlinker -Ttext -Xlinker 40000000 \
-L../../../lib -loskit_c -loskit_lmm

usermain_malloc: $(USER_CRT) usermain_malloc.o $(USER_OBJS)
$(CC) -nostdlib -static $(USER_CRT) usermain_malloc.o $(USER_OBJS) \
$(CC) -m32 -march=i386 -nostdlib -static $(USER_CRT) usermain_malloc.o $(USER_OBJS) \
-o $@ -Xlinker -Ttext -Xlinker 40000000 \
-L../../../lib -loskit_c -loskit_lmm

Expand Down
1 change: 1 addition & 0 deletions examples/x86/threads/http_proxy.c
Original file line number Diff line number Diff line change
Expand Up @@ -705,6 +705,7 @@ deathwatch(void *arg)
}
}
done:
;
}
return 0;
}
Expand Down
2 changes: 1 addition & 1 deletion kern/x86/gdb_trap_ss.S
Original file line number Diff line number Diff line change
Expand Up @@ -126,5 +126,5 @@ ENTRY(gdb_trap_ss)
ret

.comm returnaddr,4
//.comm gdb_state,TR_USIZE
.comm gdb_state,TR_USIZE
.comm gdb_stack,GDB_STACK_SIZE

0 comments on commit c9e5fcd

Please sign in to comment.