From d0c9b8c4c4a9413f4c3f0fe12e63a1989899b96d Mon Sep 17 00:00:00 2001 From: kvothe Date: Wed, 19 Aug 2020 14:10:26 +0000 Subject: [PATCH] The VM stores data in big endian format, so I'm tinkering around with libmach to see about how to convert that to native representations, regardless of compiler architecture. --- main.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/main.c b/main.c index 61115f7..26dd8a3 100644 --- a/main.c +++ b/main.c @@ -2,6 +2,8 @@ #include #include #include +#include +#include #include "graphics.h" enum { @@ -31,10 +33,13 @@ void changeState(void) { void main(void) { + ulong number = 0x01020304; + ulong converted = beswal(number); + print("%08ulx, %08ulx\n", number, converted); if(initdraw(nil, nil, "Another Plan") < 0) { sysfatal("initdraw failed: %r"); } - initGraphics(); + initGraphics(); einit(Emouse | Ekeyboard); int child = rfork(RFPROC|RFMEM);