Skip to content

Commit

Permalink
64-bit compile
Browse files Browse the repository at this point in the history
  • Loading branch information
rswier committed Apr 6, 2019
1 parent 1e75223 commit d925337
Show file tree
Hide file tree
Showing 5 changed files with 445 additions and 432 deletions.
6 changes: 3 additions & 3 deletions boot.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#!/bin/sh
rm -f xc xem xmkfs root/bin/c root/etc/os root/etc/sfs.img fs.img
gcc -o xc -O3 -m32 -Ilinux -Iroot/lib root/bin/c.c
gcc -o xem -O3 -m32 -Ilinux -Iroot/lib root/bin/em.c -lm
#gcc -o xem -O3 -Ilinux -Iroot/lib root/bin/emsafe.c -lm
gcc -o xc -O3 -Ilinux -Iroot/lib root/bin/c.c
#gcc -o xem -O3 -m32 -Ilinux -Iroot/lib root/bin/em.c -lm
gcc -o xem -O3 -Ilinux -Iroot/lib root/bin/emsafe.c -lm
gcc -o xmkfs -O3 -Ilinux -Iroot/lib root/etc/mkfs.c
./xc -o root/bin/c -Iroot/lib root/bin/c.c
./xc -o root/etc/os -Iroot/lib root/etc/os.c
Expand Down
12 changes: 6 additions & 6 deletions linux/libc.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ int xclose(int d)
int r;
if ((uint)d >= NOFILE) return -1;
switch (xft[d]) {
case xSOCKET:
case xSOCKET:
case xFILE: r = close(xfd[d]); break;
case xDIR: closedir(xdir[d]); r = 0; break;
}
Expand All @@ -64,7 +64,7 @@ int xread(int d, void *b, int n)
{
struct dirent *de;
int c;

if ((uint)d >= NOFILE) return -1;
switch (xft[d]) {
case xSOCKET: return read(xfd[d], b, n);
Expand Down Expand Up @@ -111,7 +111,7 @@ int xdprintf(int d, char *f, ...)
static char buf[4096]; va_list v; int n;
va_start(v, f);
n = vsprintf(buf, f, v);
va_end(v);
va_end(v);
return xwrite(d, buf, n);
}
int xvdprintf(int d, char *f, va_list v)
Expand Down Expand Up @@ -201,9 +201,9 @@ int main(int argc, char *argv[])
int i;
tcgetattr(0,&sttybuf);
sttybuf.c_lflag &= ~(ECHO | ICANON);
tcsetattr(0,TCSANOW,&sttybuf);
for (i=0; i<3; i++) { xfd[i] = i; xft[i] = xCONSOLE; }
for (i=3; i<NOFILE; i++) { xfd[i] = -1; xft[i] = xCLOSED; }
tcsetattr(0,TCSANOW,&sttybuf);
for (i=0; i<3; i++) { xfd[i] = i; xft[i] = xCONSOLE; }
for (i=3; i<NOFILE; i++) { xfd[i] = -1; xft[i] = xCLOSED; }
xexit(xmain(argc, argv));
}

Expand Down
Loading

0 comments on commit d925337

Please sign in to comment.