1
0
mirror of https://github.com/sgmarz/osblog.git synced 2024-11-23 18:06:20 +04:00

Added calculations to helloworld

This commit is contained in:
Stephen Marz 2020-04-25 21:35:32 -04:00
parent 0c649f5370
commit eab4a20a61
2 changed files with 10 additions and 0 deletions

View File

@ -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);

View File

@ -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;
}