mirror of
https://github.com/sgmarz/osblog.git
synced 2024-11-24 02:16:19 +04:00
Added calculations to helloworld
This commit is contained in:
parent
0c649f5370
commit
eab4a20a61
@ -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);
|
||||
|
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user