This commit is contained in:
Ciro Santilli 六四事件 法轮功
2020-01-16 00:00:00 +00:00
parent 428d5f6ac2
commit 9cb2f48725
2 changed files with 23 additions and 6 deletions

View File

@@ -14431,7 +14431,15 @@ Maybe some day someone will use this setup to study the performance of interpret
==== Python ==== Python
Build and install the interpreter on the target: Examples:
* link:rootfs_overlay/lkmc/python/hello.py[]: hello world
* `time`
** link:rootfs_overlay/lkmc/python/count.py[]: count once every second
===== Build and install the interpreter
Buildroot has a Python package that can be added to the guest image:
.... ....
./build-buildroot --config 'BR2_PACKAGE_PYTHON3=y' ./build-buildroot --config 'BR2_PACKAGE_PYTHON3=y'
@@ -14473,7 +14481,9 @@ Non-interactive usage:
./run --userland "$(./getvar buildroot_target_dir)/usr/bin/python3" --userland-args rootfs_overlay/lkmc/python/hello.py ./run --userland "$(./getvar buildroot_target_dir)/usr/bin/python3" --userland-args rootfs_overlay/lkmc/python/hello.py
.... ....
LKMC 50ac89b779363774325c81157ec8b9a6bdb50a2f gem5 390a74f59934b85d91489f8a563450d8321b602da: ===== Python gem5 user mode simulation
At LKMC 50ac89b779363774325c81157ec8b9a6bdb50a2f gem5 390a74f59934b85d91489f8a563450d8321b602da:
.... ....
./run \ ./run \
@@ -14510,10 +14520,6 @@ fatal: syscall unused#278 (#278) unimplemented.
which corresponds to the glorious `getrandom` syscall: https://github.com/torvalds/linux/blob/v4.17/include/uapi/asm-generic/unistd.h#L707 which corresponds to the glorious `getrandom` syscall: https://github.com/torvalds/linux/blob/v4.17/include/uapi/asm-generic/unistd.h#L707
Examples:
* link:rootfs_overlay/lkmc/python/hello.py[]: hello world
==== Node.js ==== Node.js
Host installation shown at: https://askubuntu.com/questions/594656/how-to-install-the-latest-versions-of-nodejs-and-npm/971612#971612 Host installation shown at: https://askubuntu.com/questions/594656/how-to-install-the-latest-versions-of-nodejs-and-npm/971612#971612

View File

@@ -0,0 +1,11 @@
#!/usr/bin/env python3
# https://cirosantilli.com/linux-kernel-module-cheat#python
import time
i = 0
while True:
print(i)
time.sleep(1)
i += 1