mirror of
https://github.com/Leonmmcoset/cleonos.git
synced 2026-04-24 11:14:01 +00:00
版本号
This commit is contained in:
@@ -38,7 +38,7 @@ python wine/cleonos_wine.py build/x86_64/ramdisk_root/shell/shell.elf --rootfs b
|
||||
## 支持
|
||||
|
||||
- ELF64 (x86_64) PT_LOAD 段装载
|
||||
- CLeonOS `int 0x80` syscall 0..83(含 `FD_*`、`DL_*`、`FB_*`、`PROC_*`、`STATS_*`、`EXEC_PATHV_IO`)
|
||||
- CLeonOS `int 0x80` syscall 0..84(含 `FD_*`、`DL_*`、`FB_*`、`PROC_*`、`STATS_*`、`EXEC_PATHV_IO`、`KERNEL_VERSION`)
|
||||
- TTY 输出与键盘输入队列
|
||||
- rootfs 文件/目录访问(`FS_*`)
|
||||
- `/temp` 写入限制(`FS_MKDIR/WRITE/APPEND/REMOVE`)
|
||||
@@ -51,8 +51,14 @@ python wine/cleonos_wine.py build/x86_64/ramdisk_root/shell/shell.elf --rootfs b
|
||||
- 文件描述符(`FD_OPEN/FD_READ/FD_WRITE/FD_CLOSE/FD_DUP`)
|
||||
- 动态库兼容加载(`DL_OPEN/DL_CLOSE/DL_SYM`,基于 ELF 符号解析)
|
||||
- framebuffer 兼容(`FB_INFO/FB_BLIT/FB_CLEAR`,支持内存缓冲与窗口显示)
|
||||
- 内核版本查询(`KERNEL_VERSION`)
|
||||
- 异常退出状态编码与故障元信息(`PROC_LAST_SIGNAL/PROC_FAULT_*`)
|
||||
|
||||
## 版本策略
|
||||
|
||||
- CLeonOS-Wine 版本号固定为:`85.0.0-wine`
|
||||
- 该值来源于“当前实现 syscall 数量 = 85(0..84)”,按项目约定后续不再变更
|
||||
|
||||
## 参数
|
||||
|
||||
- `--no-kbd`:关闭输入线程
|
||||
|
||||
Binary file not shown.
Binary file not shown.
@@ -7,6 +7,12 @@ MAX_IO_READ = 1 << 20
|
||||
DEFAULT_MAX_EXEC_DEPTH = 6
|
||||
FS_NAME_MAX = 96
|
||||
|
||||
CLKS_VERSION_STRING = "1.0.0-alpha"
|
||||
CLEONOS_VERSION_STRING = "1.0.0-alpha"
|
||||
WINE_IMPLEMENTED_SYSCALL_COUNT = 85
|
||||
# Frozen policy: this version string must not change in future updates.
|
||||
CLEONOS_WINE_VERSION_STRING = "85.0.0-wine"
|
||||
|
||||
# CLeonOS syscall IDs from cleonos/c/include/cleonos_syscall.h
|
||||
SYS_LOG_WRITE = 0
|
||||
SYS_TIMER_TICKS = 1
|
||||
@@ -92,6 +98,7 @@ SYS_EXEC_PATHV_IO = 80
|
||||
SYS_FB_INFO = 81
|
||||
SYS_FB_BLIT = 82
|
||||
SYS_FB_CLEAR = 83
|
||||
SYS_KERNEL_VERSION = 84
|
||||
|
||||
# proc states (from cleonos/c/include/cleonos_syscall.h)
|
||||
PROC_STATE_UNUSED = 0
|
||||
|
||||
@@ -9,6 +9,7 @@ from pathlib import Path
|
||||
from typing import Dict, List, Optional, Tuple
|
||||
|
||||
from .constants import (
|
||||
CLKS_VERSION_STRING,
|
||||
DEFAULT_MAX_EXEC_DEPTH,
|
||||
FD_INHERIT,
|
||||
FS_NAME_MAX,
|
||||
@@ -62,6 +63,7 @@ from .constants import (
|
||||
SYS_FS_STAT_TYPE,
|
||||
SYS_FS_WRITE,
|
||||
SYS_GETPID,
|
||||
SYS_KERNEL_VERSION,
|
||||
SYS_KBD_BUFFERED,
|
||||
SYS_KBD_DROPPED,
|
||||
SYS_KBD_GET_CHAR,
|
||||
@@ -713,6 +715,8 @@ class CLeonOSWineNative:
|
||||
return self._fb_blit(uc, arg0)
|
||||
if sid == SYS_FB_CLEAR:
|
||||
return self._fb_clear(arg0)
|
||||
if sid == SYS_KERNEL_VERSION:
|
||||
return self._kernel_version(uc, arg0, arg1)
|
||||
|
||||
return u64_neg1()
|
||||
|
||||
@@ -1889,6 +1893,23 @@ class CLeonOSWineNative:
|
||||
|
||||
return int(u64(addr)) if addr is not None else 0
|
||||
|
||||
def _kernel_version(self, uc: Uc, out_ptr: int, out_size: int) -> int:
|
||||
if out_ptr == 0 or out_size <= 0:
|
||||
return 0
|
||||
|
||||
max_copy = int(out_size) - 1
|
||||
if max_copy < 0:
|
||||
return 0
|
||||
|
||||
payload = CLKS_VERSION_STRING.encode("utf-8", errors="replace")
|
||||
if len(payload) > max_copy:
|
||||
payload = payload[:max_copy]
|
||||
|
||||
if not self._write_guest_bytes(uc, int(out_ptr), payload + b"\x00"):
|
||||
return 0
|
||||
|
||||
return len(payload)
|
||||
|
||||
def _fb_info(self, uc: Uc, out_ptr: int) -> int:
|
||||
if out_ptr == 0:
|
||||
return 0
|
||||
|
||||
Reference in New Issue
Block a user