Skip to content

Instantly share code, notes, and snippets.

View amwatson's full-sized avatar

Amanda Watson amwatson

View GitHub Profile
34c34,35
< tail( 0 )
---
> tail( 0 ),
> synced( false )
85c86
< bool MessageQueue::PostMessage( const char * msg, bool synced, bool abortIfFull )
---
> bool MessageQueue::PostMessage( const char * msg, bool sync, bool abortIfFull )
104c105
FS info: MROF 792
First file: basic_test 344 104
idle
Thread 4 forked
thread 4 choosing to wait
Thread 3 forked
thread 3 choosing to wait
Thread 2 forked
thread 2 choosing to wait
Thread 1 forked
Moroso code:
let tcb = thr_create(null, null, 0);
C output:
struct tcb* tcb = (tcb *)thr_create(NULL, NULL, 0);
gcc error:
error: expected expression before ‘)’ token
[problem does not exist when '(tcb *)' is removed]
int main() { int* static_array ;;
((static_array)[0]) = (1); return 0; }
@amwatson
amwatson / gist:f811a1f4f6757806893c
Created June 3, 2014 20:45
placing the body of static_array_access in main() seems to be fine, but the call results in a segfault
fn static_array_access() {
let static_array: u32[50];
static_array[0] = 1;
}
fn main() -> i32 {
static_array_access();
0
}
commit caf89664c4fef21052373925de6ebc893bc4ec77
Author: Amanda M. Watson <[email protected]>
Date: Mon Apr 14 20:11:18 2014 -0400
fixed cr2 race
diff --git a/kern/interrupts/page_fault_handler.c b/kern/interrupts/page_fault_handler.c
index f5e7ef3..5c773bd 100644
--- a/kern/interrupts/page_fault_handler.c
+++ b/kern/interrupts/page_fault_handler.c