-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
37 lines (28 loc) · 704 Bytes
/
main.py
File metadata and controls
37 lines (28 loc) · 704 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
from kernel.kernel import *
import uasyncio as asyncio
proc_code1 = '''
print(f"USER: Started with PID {pid}")
request = {
"cmd": "write",
"path": "/home/log.txt",
"data": "cool message!",
"client_pid": pid,
"reply_pipe": 1
}
request2 = {
"cmd": "cat",
"path": "/home/log.txt",
"client_pid": pid,
"reply_pipe": 1
}
print(f"USER: Writing and reading /home/log.txt via pipe 0...")
await send(0, request, pid)
await recv(1, pid)
await send(0, request2, pid)
data = await recv(1, pid)
print(f"USER: Result from FS: {data}")
'''
if __name__ == "__main__":
create_proc(proc_code1, 1)
boot()
asyncio.run(scheduler())