feat(panic): FUCK [panic] mode=strict|fallback + realtest image variant

- UTSM panic_full returns in fallback mode (logs [PANIC:FALLBACK] + code + hit
  count); panic_halt keeps always-halt sites (CPU exception, VMM-E11 LA57,
  VMM-E15 DSK jump, UTSM-E42 test hook). Call sites given safe continuations.
- Mode passed to DSK/FirstInit/login/desktop via DSK_BOOT_FLAG_PANIC_FALLBACK;
  DKM kernel_api.panic / kern.log.panic return to driver; ext4 fatal aborts the
  op via setjmp/longjmp and DSK falls back to FAT32 ESP.
- build.ps1/Makefile: dev=strict, release=fallback, new realtest (release
  options + strict); default -Variant all; serialized iso packing under -j.
- Fix '*/' inside comments (dkm.h, kernel_api.h, bus.c) that broke the build.
- Includes pending work: dkm_bus service bus, mt7920/wlan drivers, desktop
  files/startmenu/prank, pe-tools, diskinfo, docs.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Linehu
2026-10-12 23:57:19 +08:00
co-authored by Cursor
parent a7e5b2bc7a
commit 8554a82677
84 changed files with 7325 additions and 484 deletions
+58
View File
@@ -26,6 +26,26 @@ struct dkm_log_api {
void (*panic)(const char *msg);
};
/* D6 万物互联:dkm_bus 镜像(布局对齐 UTSM include/utsm/dkm.h) */
struct dkm_bus_service {
char name[48];
u32 version;
u32 flags;
void *fn;
const void *provider;
};
struct dkm_bus_api {
u32 magic;
u32 version;
int (*register_service)(const char *name, u32 version, void *fn);
int (*unregister_service)(const char *name);
int (*lookup)(const char *name, void **out_fn, u32 *out_version);
int (*probe)(const char *name, void **out_fn, u32 *out_version);
u32 (*count)(void);
const struct dkm_bus_service *(*at)(u32 index);
};
struct dkm_kernel_api {
u32 version;
u32 size;
@@ -47,6 +67,19 @@ struct dkm_kernel_api {
u64 fb_pitch;
u16 fb_bpp;
const void *boot_modules_response;
/* —— 尾部追加字段镜像(DKM_ABI v1;到 bus 为止) —— */
void *irq_register; /* int (*)(u8, void*) */
u64 hhdm_offset;
const void *block;
const void *mmio;
void *mm_map_mmio;
void *mm_unmap_mmio;
void *register_apic_eoi;
void *irq_vector_alloc;
void *irq_vector_free;
const void *sched;
const void *kapi;
const struct dkm_bus_api *bus;
};
struct dkm_driver_handle;
@@ -185,6 +218,31 @@ int driver_init(const struct dkm_kernel_api *api,
devfs_file("fb0", info);
}
/* /dev/services — D6 万物互联:总线已注册服务清单 */
if (api->bus && api->bus->magic == 0x53425553u /* "SBUS" */) {
char cnt[24];
cnt[0] = '0'; cnt[1] = 'x';
u64 v = api->bus->count();
u32 p = 2;
if (v == 0) cnt[p++] = '0';
else {
char r[18]; u32 q = 0;
while (v) { r[q++] = "0123456789abcdef"[v&0xf]; v>>=4; }
while (q) cnt[p++] = r[--q];
}
cnt[p] = 0;
devfs_file("services", cnt);
g_log->info("[devfs] /dev/services/");
for (u32 i = 0; i < api->bus->count(); i++) {
const struct dkm_bus_service *s = api->bus->at(i);
if (s && s->name[0]) {
g_log->info("[devfs] ");
g_log->info(s->name);
}
}
}
/* /dev/modules — count from boot_modules */
const struct limine_module_response *rsp =
(const struct limine_module_response *)api->boot_modules_response;