Permalink
Browse files

Merge branch 'feature/availbits' into unborn

  • Loading branch information...
2 parents 19e4377 + 15dc66c commit f62c8bbaae68510b907f84cb2f1fd153917f091d @wolfwood wolfwood committed Aug 14, 2011
Showing with 1,498 additions and 2,213 deletions.
  1. +5 −5 app/c/hello/hello.c
  2. +1 −1 app/c/simplyfft/simplyfft.c
  3. +2 −2 app/c/simplymd5/simplymd5.c
  4. +1 −1 app/c/simplymm/simplymm.c
  5. +9 −9 app/d/hello/console.d
  6. +4 −6 app/d/hello/hello.d
  7. +9 −9 app/d/init/console.d
  8. +2 −2 app/d/init/embeddedfs.d
  9. +9 −14 app/d/init/init.d
  10. +6 −8 app/d/posix/posix.d
  11. +9 −9 app/d/xsh/console.d
  12. +20 −18 app/d/xsh/xsh.d
  13. +17 −21 kernel/arch/x86_64/architecture/cpu.d
  14. +4 −4 kernel/arch/x86_64/architecture/keyboard.d
  15. +3 −3 kernel/arch/x86_64/architecture/main.d
  16. +2 −2 kernel/arch/x86_64/architecture/perfmon.d
  17. +4 −6 kernel/arch/x86_64/architecture/syscall.d
  18. +66 −25 kernel/arch/x86_64/architecture/vm.d
  19. +3 −1 kernel/arch/x86_64/boot/boot.s
  20. +1 −1 kernel/arch/x86_64/boot/trampoline.s
  21. +4 −2 kernel/arch/x86_64/core/gdt.d
  22. +6 −3 kernel/arch/x86_64/core/info.d
  23. +5 −2 kernel/arch/x86_64/core/ioapic.d
  24. +6 −3 kernel/arch/x86_64/core/lapic.d
  25. +337 −523 kernel/arch/x86_64/core/paging.d
  26. +4 −2 kernel/arch/x86_64/core/tss.d
  27. +0 −16 kernel/arch/x86_64/imports/architecture.d
  28. +0 −137 kernel/arch/x86_64/pagetable.d
  29. +42 −41 kernel/arch/x86_64/specs/acpitables.d
  30. +3 −2 kernel/arch/x86_64/specs/mp.d
  31. +17 −17 kernel/core/initprocess.d
  32. +3 −3 kernel/core/kmain.d
  33. +1 −1 kernel/core/log.d
  34. +28 −38 kernel/core/syscall.d
  35. +1 −1 kernel/core/util.d
  36. +20 −21 kernel/dev/console.d
  37. +11 −10 kernel/dev/keyboard.d
  38. +14 −14 kernel/mem/bestbin.d
  39. +4 −4 kernel/mem/binhop.d
  40. +7 −61 kernel/mem/bitmap.d
  41. +14 −29 kernel/mem/pageallocator.d
  42. +3 −3 kernel/mem/pagecolor.d
  43. +4 −4 kernel/mem/private_cache.d
  44. +1 −1 kernel/runtime/std/c/stdarg.d
  45. +5 −5 kernel/runtime/std/intrinsic.d
  46. +1 −1 kernel/runtime/std/stdarg.d
  47. +4 −2 kernel/system/definitions.d
  48. +5 −3 kernel/system/multiboot.d
  49. +7 −9 libos/console.d
  50. +6 −6 libos/elf/elf.d
  51. +7 −9 libos/elf/loader.d
  52. +1 −1 libos/elf/segment.d
  53. +35 −31 libos/fs/minfs.d
  54. +1 −1 libos/keyboard.d
  55. +25 −22 libos/libdeepmajik/threadscheduler.d
  56. +6 −23 libos/libdeepmajik/umm.d
  57. +0 −348 libos/ramfs.d
  58. +1 −1 libos/video.d
  59. +8 −8 runtimes/mindrt/Makefile
  60. +1 −1 runtimes/mindrt/assocarray.d
  61. +3 −3 runtimes/mindrt/entry.S
  62. +4 −34 runtimes/mindrt/entry.d
  63. +3 −3 runtimes/mindrt/object.d
  64. +1 −1 runtimes/mindrt/typeinfo/ti_array_cfloat.d
  65. +1 −1 tools/dtoc/test.c
  66. +2 −2 user/c/Makefile
  67. +5 −4 user/c/csyscall.d
  68. +415 −586 user/environment.d
  69. +170 −0 user/ipc.d
  70. +0 −1 user/ramfs.d
  71. +13 −20 user/syscall.d
  72. +54 −0 user/types.d
  73. +2 −2 user/util.d
View
@@ -11,10 +11,10 @@ int main(int argc, char** argv){
char *hello = "hello world\n";
fprintf(stdout, "%s!\n", hello);
-
+
wconsole(hello, 11);
-
+
printf("Hello wizzerld!\n");
int fd = open("/LICENSE", O_RDONLY);
@@ -24,7 +24,7 @@ int main(int argc, char** argv){
do{
err = read(fd, foo, 10);
-
+
if(err > 0){
foo[err] = '\0';
printf(foo);
@@ -35,9 +35,9 @@ int main(int argc, char** argv){
printf("\n");
int wfd = open("/out", O_WRONLY);
-
+
char* moo = "The quick brown w0lfwood jumped over the lazy cl0ckw0rk.\n";
-
+
printf("write to fd %d\n", wfd);
write(wfd, moo, strlen(moo));
@@ -5,7 +5,7 @@
* Code computes fft of an array of complex doubles and mutates
* in-place this array to give a complex double result.
*
- * Code is from a module by Dmitry Karasik, and available:
+ * Code is from a module by Dmitry Karasik, and available:
* http://cpansearch.perl.org/src/KARASIK/IPA-1.07/Global/fft.c
*
*/
@@ -40,7 +40,7 @@ void MD5Transform(uint32 buf[4], uint32 const in[16]);
int mdfile(char *fn, unsigned char *digest);
int mdbinfile(char *fn, unsigned char *bindigest);
-/* These assume a little endian machine and return incorrect results!
+/* These assume a little endian machine and return incorrect results!
* They are here for compatibility with old (broken) versions of RPM */
int mdfileBroken(char *fn, unsigned char *digest);
int mdbinfileBroken(char *fn, unsigned char *bindigest);
@@ -173,7 +173,7 @@ void MD5Update(struct MD5Context *ctx, unsigned char const *buf, unsigned len)
}
/*
- * * Final wrapup - pad to 64-byte boundary with the bit pattern
+ * * Final wrapup - pad to 64-byte boundary with the bit pattern
* * 1 0* (64-bit count of bits processed, MSB-first)
* */
void MD5Final(unsigned char digest[16], struct MD5Context *ctx)
@@ -20,7 +20,7 @@ struct bigint {
};
void main() {
-
+
ticks header_t0, header_t1, read_t0, read_t1, compute_t0, compute_t1, write_t0, write_t1;
header_t0 = getticks();
View
@@ -43,7 +43,7 @@ static:
void putChar(char foo) {
return SysConsole.Console.putChar(foo);
- }
+ }
uint width() {
return SysConsole.Console.width();
@@ -278,7 +278,7 @@ string ftoa(float val, uint base = 10) {
ret ~= cast(char)((fracPart >> 24) + '0');
fracPart &= 0xffffff;
}
-
+
// round last digit
bool roundUp = (ret[$-1] >= '5');
ret = ret[0..$-1];
@@ -373,7 +373,7 @@ string dtoa(double val, uint base = 10, bool doIntPart = true) {
ret ~= cast(char)((fracPart >> 53) + '0');
fracPart &= 0x1fffffffffffff;
}
-
+
// round last digit
bool roundUp = (ret[$-1] >= '5');
ret = ret[0..$-1];
@@ -422,7 +422,7 @@ string rtoa(real val, uint base = 10) {
long mantissa;
long intPart;
long fracPart;
-
+
long exp;
longReal iF;
@@ -441,7 +441,7 @@ string rtoa(real val, uint base = 10) {
mantissa = iF.l.frac;
fracPart = 0;
intPart = 0;
-
+
if (exp >= 31) {
return "0";
}
@@ -463,18 +463,18 @@ string rtoa(real val, uint base = 10) {
if (iF.l.exp < 0) {
ret = "-";
}
-
+
ret ~= itoa(intPart, base);
ret ~= ".";
for (uint k; k < 7; k++) {
fracPart *= 10;
ret ~= cast(char)((fracPart >> 64) + '0');
}
-
+
// round last digit
bool roundUp = (ret[$-1] >= '5');
ret = ret[0..$-1];
-
+
while (roundUp) {
if (ret.length == 0) {
return "0";
@@ -486,7 +486,7 @@ string rtoa(real val, uint base = 10) {
ret[$-1]++;
break;
}
-
+
// get rid of useless zeroes (and point if necessary)
foreach_reverse(uint i, chr; ret) {
if (chr != '0' && chr != '.') {
View
@@ -6,22 +6,20 @@
module hello;
-import user.syscall;
-
import console;
-import libos.keyboard;
-import user.environment;
+// requied by entry.
+import libos.keyboard;
import libos.libdeepmajik.threadscheduler;
void main(char[][] argv) {
- Console.backcolor = Color.Black;
+ Console.backcolor = Color.Black;
Console.forecolor = Color.Green;
Console.putString("\nHello, and Welcome to XOmB\n");
Console.putString( "-=-=-=-=-=-=-=-\n\n");
- Console.backcolor = Color.Black;
+ Console.backcolor = Color.Black;
Console.forecolor = Color.LightGray;
foreach(str; argv){
View
@@ -43,7 +43,7 @@ static:
void putChar(char foo) {
return SysConsole.Console.putChar(foo);
- }
+ }
uint width() {
return SysConsole.Console.width();
@@ -278,7 +278,7 @@ string ftoa(float val, uint base = 10) {
ret ~= cast(char)((fracPart >> 24) + '0');
fracPart &= 0xffffff;
}
-
+
// round last digit
bool roundUp = (ret[$-1] >= '5');
ret = ret[0..$-1];
@@ -373,7 +373,7 @@ string dtoa(double val, uint base = 10, bool doIntPart = true) {
ret ~= cast(char)((fracPart >> 53) + '0');
fracPart &= 0x1fffffffffffff;
}
-
+
// round last digit
bool roundUp = (ret[$-1] >= '5');
ret = ret[0..$-1];
@@ -422,7 +422,7 @@ string rtoa(real val, uint base = 10) {
long mantissa;
long intPart;
long fracPart;
-
+
long exp;
longReal iF;
@@ -441,7 +441,7 @@ string rtoa(real val, uint base = 10) {
mantissa = iF.l.frac;
fracPart = 0;
intPart = 0;
-
+
if (exp >= 31) {
return "0";
}
@@ -463,18 +463,18 @@ string rtoa(real val, uint base = 10) {
if (iF.l.exp < 0) {
ret = "-";
}
-
+
ret ~= itoa(intPart, base);
ret ~= ".";
for (uint k; k < 7; k++) {
fracPart *= 10;
ret ~= cast(char)((fracPart >> 64) + '0');
}
-
+
// round last digit
bool roundUp = (ret[$-1] >= '5');
ret = ret[0..$-1];
-
+
while (roundUp) {
if (ret.length == 0) {
return "0";
@@ -486,7 +486,7 @@ string rtoa(real val, uint base = 10) {
ret[$-1]++;
break;
}
-
+
// get rid of useless zeroes (and point if necessary)
foreach_reverse(uint i, chr; ret) {
if (chr != '0' && chr != '.') {
View
@@ -8,7 +8,7 @@ struct EmbeddedFS{
static:
void makeFS(){
MinFS.format();
-
+
// binaries
xsh = makeFile!("binaries/xsh", true)();
makeFile!("binaries/hello", true)();
@@ -24,7 +24,7 @@ struct EmbeddedFS{
MinFS.link("/binaries/posix", "/binaries/echo");
MinFS.link("/binaries/posix", "/binaries/ls");
MinFS.link("/binaries/posix", "/binaries/ln");
-
+
// data
makeFile!("LICENSE", false)();
}
View
@@ -8,20 +8,15 @@ module init;
import embeddedfs;
-import user.syscall;
-import user.environment;
-
-import libos.fs.minfs;
+import Syscall = user.syscall;
+import user.ipc;
+import user.types;
import console;
-import libos.keyboard;
-
-import user.keycodes;
+import libos.keyboard;
import libos.libdeepmajik.threadscheduler;
-import mindrt.util;
-
void main(char[][] argv) {
MessageInAbottle* bottle = MessageInAbottle.getMyBottle();
@@ -31,21 +26,21 @@ void main(char[][] argv) {
EmbeddedFS.makeFS();
// say hello
- Console.backcolor = Color.Black;
+ Console.backcolor = Color.Black;
Console.forecolor = Color.Green;
Console.putString("\nWelcome to XOmB\n");
Console.putString( "-=-=-=-=-=-=-=-\n\n");
-
- Console.backcolor = Color.Black;
+
+ Console.backcolor = Color.Black;
Console.forecolor = Color.LightGray;
// yield to xsh
- AddressSpace xshAS = createAddressSpace();
+ AddressSpace xshAS = Syscall.createAddressSpace();
const char[][] args = ["xsh", "arg"];
- File xsh = EmbeddedFS.shell();
+ ubyte[] xsh = EmbeddedFS.shell();
if(xsh !is null){
populateChild(args, xshAS, xsh);
View
@@ -10,9 +10,7 @@ import libos.keyboard;
import libos.libdeepmajik.threadscheduler;
import libos.fs.minfs;
-// exit
-import user.syscall;
-import user.environment;
+import user.ipc;
void main(char[][] argv){
if(argv.length < 1){
@@ -101,7 +99,7 @@ void main(char[][] argv){
Console.putString("File ");
Console.putString(argv[1]);
Console.putString(" Does Not Exist!\n");
-
+
exit(1);
}
@@ -110,10 +108,10 @@ void main(char[][] argv){
Console.putString("File ");
Console.putString(argv[2]);
Console.putString(" Does Not Exist!\n");
-
+
exit(1);
}
-
+
ulong* size = cast(ulong*)f.ptr;
memcpy(g.ptr, f.ptr, *size + ulong.sizeof);
@@ -169,7 +167,7 @@ void main(char[][] argv){
Console.putString("target already exists!\n");
//return(1);
}
-
+
//return(0);
break;
case "ls":
@@ -191,7 +189,7 @@ void main(char[][] argv){
}
}
break;
- default:
+ default:
Console.putString("Posix: command '");
foreach(str; argv){
Console.putString(str);
Oops, something went wrong.

0 comments on commit f62c8bb

Please sign in to comment.