From f2a04952276728ba5ae000d5179bba4494eb73f9 Mon Sep 17 00:00:00 2001 From: Mitchell Waite Date: Thu, 19 Feb 2026 00:48:38 -0500 Subject: [PATCH 1/3] Add ATA model string to the device struct Allows libxenon apps (and my XeLL BIOS theme) to more easily print device inquiry strings without janky libxenon hacks. Instead, we can silence the init prints with console_close/console_open and print the model string later --- libxenon/drivers/diskio/ata.c | 12 ++++++++++-- libxenon/drivers/diskio/ata.h | 2 ++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/libxenon/drivers/diskio/ata.c b/libxenon/drivers/diskio/ata.c index 5ba87836..3893cdf5 100644 --- a/libxenon/drivers/diskio/ata.c +++ b/libxenon/drivers/diskio/ata.c @@ -241,7 +241,11 @@ xenon_ata_dumpinfo(struct xenon_ata_device *dev, char *info) { printf(" * Firmware: %s\n", text); strncpy(text, data + 54, 40); text[40] = 0; - printf(" * Model: %s\n", text); + + strncpy(dev->model, text, sizeof(dev->model)); + (dev->model)[sizeof(dev->model) - 1] = '\0'; + + printf(" * Model: %s\n", dev->model); if (!dev->atapi) { printf(" * Addressing mode: %d\n", dev->addressing_mode); @@ -456,7 +460,11 @@ xenon_atapi_inquiry_model(struct xenon_ata_device *dev) { }; buf[8 + 24] = '\0'; - printf("ATAPI inquiry model: %s\n", &buf[8]); + + strncpy(dev->model, &buf[8], sizeof(dev->model)); + (dev->model)[sizeof(dev->model) - 1] = '\0'; + + printf("ATAPI inquiry model: %s %d\n", dev->model); return 0; } diff --git a/libxenon/drivers/diskio/ata.h b/libxenon/drivers/diskio/ata.h index 35cffdb6..14c10f77 100644 --- a/libxenon/drivers/diskio/ata.h +++ b/libxenon/drivers/diskio/ata.h @@ -80,6 +80,8 @@ extern "C" { struct bdev *bdev; struct xenon_ata_dma_prd * prds; + + char model[0x30]; }; struct xenon_atapi_read { From 7808470c1cb3767a5655d78190a10d8d40a1f8b9 Mon Sep 17 00:00:00 2001 From: Mitchell Waite Date: Thu, 19 Feb 2026 00:59:43 -0500 Subject: [PATCH 2/3] Don't need to explicitly null terminate --- libxenon/drivers/diskio/ata.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/libxenon/drivers/diskio/ata.c b/libxenon/drivers/diskio/ata.c index 3893cdf5..98ae5b4d 100644 --- a/libxenon/drivers/diskio/ata.c +++ b/libxenon/drivers/diskio/ata.c @@ -243,8 +243,6 @@ xenon_ata_dumpinfo(struct xenon_ata_device *dev, char *info) { text[40] = 0; strncpy(dev->model, text, sizeof(dev->model)); - (dev->model)[sizeof(dev->model) - 1] = '\0'; - printf(" * Model: %s\n", dev->model); if (!dev->atapi) { @@ -462,8 +460,6 @@ xenon_atapi_inquiry_model(struct xenon_ata_device *dev) { buf[8 + 24] = '\0'; strncpy(dev->model, &buf[8], sizeof(dev->model)); - (dev->model)[sizeof(dev->model) - 1] = '\0'; - printf("ATAPI inquiry model: %s %d\n", dev->model); return 0; From 6ac5b10cbea413c46b9ea5eafe2534809f577844 Mon Sep 17 00:00:00 2001 From: Mitchell Waite Date: Thu, 19 Feb 2026 01:00:36 -0500 Subject: [PATCH 3/3] Update ata.c --- libxenon/drivers/diskio/ata.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/libxenon/drivers/diskio/ata.c b/libxenon/drivers/diskio/ata.c index 98ae5b4d..6dbcbbee 100644 --- a/libxenon/drivers/diskio/ata.c +++ b/libxenon/drivers/diskio/ata.c @@ -241,7 +241,6 @@ xenon_ata_dumpinfo(struct xenon_ata_device *dev, char *info) { printf(" * Firmware: %s\n", text); strncpy(text, data + 54, 40); text[40] = 0; - strncpy(dev->model, text, sizeof(dev->model)); printf(" * Model: %s\n", dev->model); @@ -458,7 +457,6 @@ xenon_atapi_inquiry_model(struct xenon_ata_device *dev) { }; buf[8 + 24] = '\0'; - strncpy(dev->model, &buf[8], sizeof(dev->model)); printf("ATAPI inquiry model: %s %d\n", dev->model);