Differences From Artifact [f1bdb07ea2]:
- File kcore/testbin.exe.c — part of check-in [e794c5edef] at 2019-06-29 09:31:50 on branch trunk — add a bunch of code, port the header mechanism to gpp; add a fuckton of definitions and compatibility header code; notably, add core function kstop and x86.lin.{32,64} impl. update docs accordingly (user: lexi, size: 308) [annotate] [blame] [check-ins using]
To Artifact [5796abefa5]:
- File kcore/testbin.exe.c — part of check-in [6479e060a3] at 2019-07-26 09:51:02 on branch trunk — major update. fix ridiculous old type size determination mechanism. mmap is still broken and i'm not sure why; the syscall does not appear to be going through correctly - see posix_mmap, kmheapa, and kcore/testbin.exe.fn (user: lexi, size: 515) [annotate] [blame] [check-ins using]
1 1 #include <k/core.h> 2 2 #include <k/mem.h> 3 3 #include <k/io.h> 4 4 #include <k/magic.h> 5 + 6 +struct object { 7 + u8 a; 8 + s16 b; 9 + bool c; 10 +}; 5 11 6 12 kbad entry(kenv e) { 7 13 const char msg[] = "hello from libk\n"; 8 14 ksraw ptr = { Kmsz(msg), msg }; 9 15 10 16 bool maybe = true; 11 17 maybe = no; 12 18 13 19 if (kiosend(e.std, ptr, null) == kiocond_ok) { 14 - return kbad_ok; 20 + /* great, continue */ 15 21 } else { 16 22 return kbad_io; 17 23 } 24 + 25 + struct object* block = kmheapa(sizeof (struct object) * 4); 26 + if (block == null) return kbad_mem; else return kbad_ok; 27 + 28 + block[1].a = 5; 29 + 30 + return kbad_ok; 18 31 }