From eab4a20a61de10e8d93b989454053b4b9c60841b Mon Sep 17 00:00:00 2001 From: Stephen Marz Date: Sat, 25 Apr 2020 21:35:32 -0400 Subject: [PATCH] Added calculations to helloworld --- risc_v/src/test.rs | 1 + risc_v/src/userspace/helloworld.cpp | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/risc_v/src/test.rs b/risc_v/src/test.rs index 1b3e92c..3abe88b 100644 --- a/risc_v/src/test.rs +++ b/risc_v/src/test.rs @@ -76,6 +76,7 @@ pub fn test_block() { ); } if let Some(mut pl) = unsafe { PROCESS_LIST.take() } { + println!("Added user process to the scheduler...get ready for take-off!"); pl.push_back(my_proc); unsafe { PROCESS_LIST.replace(pl); diff --git a/risc_v/src/userspace/helloworld.cpp b/risc_v/src/userspace/helloworld.cpp index beeb658..1d6f0bc 100644 --- a/risc_v/src/userspace/helloworld.cpp +++ b/risc_v/src/userspace/helloworld.cpp @@ -3,6 +3,15 @@ int main() { + int myarray[1000]; printf("I'm a C++ program, and I'm running in user space. How about a big, Hello World\n"); + printf("I'm going to start crunching some numbers, so gimme a minute.\n"); + for (int i = 0;i < 1000;i++) { + myarray[i] = 0; + } + for (int i = 0;i < 100000000;i++) { + myarray[i % 1000] += 1; + } + printf("Ok, I'm done crunching. Wanna see myarray[0]? It's %d\n", myarray[0]); return 0; }