From 4452f1b1969339bb6723628d4168f55008f429b8 Mon Sep 17 00:00:00 2001 From: kamkow1 Date: Sat, 18 Oct 2025 22:16:01 +0200 Subject: [PATCH] Change naming scheme for atasd and ramsd --- base/scripts/mount.tb | 2 +- kernel/storedev/storedev.c | 9 ++++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/base/scripts/mount.tb b/base/scripts/mount.tb index e079ce8..c9fa816 100644 --- a/base/scripts/mount.tb +++ b/base/scripts/mount.tb @@ -1,2 +1,2 @@ print 'Mounting filesystems...\n' -$fs mount -mp system -fs LittleFS -dev atasd-mst -fmt no +$fs mount -mp system -fs LittleFS -dev atasd-ch0-M -fmt no diff --git a/kernel/storedev/storedev.c b/kernel/storedev/storedev.c index 2902418..6d95555 100644 --- a/kernel/storedev/storedev.c +++ b/kernel/storedev/storedev.c @@ -24,16 +24,15 @@ void storedev_init(void) { ata_probe(); } +size_t ramsd_counter = 0; + void storedev_register_dev_entry(StoreDev *sd, int32_t sdtype) { char key[20]; - hal_memset(key, 0, sizeof(key)); if (sdtype == STOREDEV_RAMSD) { - char uniq[5]; - randcrypto_gen_uniqid(uniq, 4); - ksprintf(key, "ramsd-%s", uniq); + ksprintf(key, "ramsd-%zu", ramsd_counter++); } else if (sdtype == STOREDEV_ATASD) { - ksprintf(key, "atasd-%s", sd->sd.atasd.devno == 0x00 ? "mst" : "slv"); + ksprintf(key, "atasd-ch0-%c", sd->sd.atasd.devno == 0x00 ? 'M' : 'S'); } spinlock_acquire(&DEVTABLE.spinlock);