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.

This commit is contained in:
kvothe. 2020-08-19 14:10:26 +00:00
parent 6cfec8150d
commit d0c9b8c4c4
1 changed files with 6 additions and 1 deletions

7
main.c
View File

@ -2,6 +2,8 @@
#include <libc.h>
#include <draw.h>
#include <event.h>
#include <bio.h>
#include <mach.h>
#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);