mirror of
https://github.com/Leonmmcoset/cleonos.git
synced 2026-04-21 18:44:01 +00:00
更新shell
This commit is contained in:
@@ -54,6 +54,8 @@ SYS_WAITPID = 42
|
||||
SYS_EXIT = 43
|
||||
SYS_SLEEP_TICKS = 44
|
||||
SYS_YIELD = 45
|
||||
SYS_SHUTDOWN = 46
|
||||
SYS_RESTART = 47
|
||||
|
||||
|
||||
def u64(value: int) -> int:
|
||||
|
||||
@@ -25,6 +25,8 @@ from .constants import (
|
||||
SYS_SPAWN_PATH,
|
||||
SYS_WAITPID,
|
||||
SYS_YIELD,
|
||||
SYS_SHUTDOWN,
|
||||
SYS_RESTART,
|
||||
SYS_FS_APPEND,
|
||||
SYS_FS_CHILD_COUNT,
|
||||
SYS_FS_GET_CHILD_NAME,
|
||||
@@ -256,6 +258,16 @@ class CLeonOSWineNative:
|
||||
return self._sleep_ticks(arg0)
|
||||
if sid == SYS_YIELD:
|
||||
return self._yield_once()
|
||||
if sid == SYS_SHUTDOWN:
|
||||
self._host_write("\n[WINE] shutdown requested by guest\n")
|
||||
self._exit_requested = True
|
||||
self._exit_status = 0
|
||||
return 1
|
||||
if sid == SYS_RESTART:
|
||||
self._host_write("\n[WINE] restart requested by guest\n")
|
||||
self._exit_requested = True
|
||||
self._exit_status = 0
|
||||
return 1
|
||||
if sid == SYS_EXEC_REQUESTS:
|
||||
return self.state.exec_requests
|
||||
if sid == SYS_EXEC_SUCCESS:
|
||||
@@ -874,4 +886,4 @@ def resolve_elf_target(elf_arg: str, rootfs: Path) -> Tuple[Path, str]:
|
||||
host_path = _guest_to_host_for_resolve(rootfs, guest_path)
|
||||
if host_path is None:
|
||||
raise FileNotFoundError(f"ELF not found as host path or guest path: {elf_arg}")
|
||||
return host_path.resolve(), guest_path
|
||||
return host_path.resolve(), guest_path
|
||||
|
||||
Reference in New Issue
Block a user