mirror of
https://github.com/limine-bootloader/limine
synced 2024-11-24 01:19:38 +03:00
limine: Add media type to limine_file structure
This commit is contained in:
parent
012e7b0b67
commit
5c7578c54a
12
PROTOCOL.md
12
PROTOCOL.md
@ -752,16 +752,21 @@ struct limine_uuid {
|
||||
uint8_t d[8];
|
||||
};
|
||||
|
||||
#define LIMINE_MEDIA_TYPE_GENERIC 0
|
||||
#define LIMINE_MEDIA_TYPE_OPTICAL 1
|
||||
#define LIMINE_MEDIA_TYPE_TFTP 2
|
||||
|
||||
struct limine_file {
|
||||
uint64_t revision;
|
||||
void *address;
|
||||
uint64_t size;
|
||||
char *path;
|
||||
char *cmdline;
|
||||
uint64_t partition_index;
|
||||
uint32_t media_type;
|
||||
uint32_t unused;
|
||||
uint32_t tftp_ip;
|
||||
uint32_t tftp_port;
|
||||
uint32_t partition_index;
|
||||
uint32_t mbr_disk_id;
|
||||
struct limine_uuid gpt_disk_uuid;
|
||||
struct limine_uuid gpt_part_uuid;
|
||||
@ -774,11 +779,12 @@ struct limine_file {
|
||||
* `size` - The size of the file.
|
||||
* `path` - The path of the file within the volume, with a leading slash.
|
||||
* `cmdline` - A command line associated with the file.
|
||||
* `partition_index` - 1-based partition index of the volume from which the
|
||||
file was loaded. If 0, it means invalid or unpartitioned.
|
||||
* `media_type` - Type of media file resides on.
|
||||
* `tftp_ip` - If non-0, this is the IP of the TFTP server the file was loaded
|
||||
from.
|
||||
* `tftp_port` - Likewise, but port.
|
||||
* `partition_index` - 1-based partition index of the volume from which the
|
||||
file was loaded. If 0, it means invalid or unpartitioned.
|
||||
* `mbr_disk_id` - If non-0, this is the ID of the disk the file was loaded
|
||||
from as reported in its MBR.
|
||||
* `gpt_disk_uuid` - If non-0, this is the UUID of the disk the file was
|
||||
|
@ -47,11 +47,17 @@ static struct limine_file get_file(struct file_handle *file, char *cmdline) {
|
||||
struct limine_file ret = {0};
|
||||
|
||||
if (file->pxe) {
|
||||
ret.media_type = LIMINE_MEDIA_TYPE_TFTP;
|
||||
|
||||
ret.tftp_ip = file->pxe_ip;
|
||||
ret.tftp_port = file->pxe_port;
|
||||
} else {
|
||||
struct volume *vol = file->vol;
|
||||
|
||||
if (vol->is_optical) {
|
||||
ret.media_type = LIMINE_MEDIA_TYPE_OPTICAL;
|
||||
}
|
||||
|
||||
ret.partition_index = vol->partition;
|
||||
|
||||
ret.mbr_disk_id = mbr_get_id(vol);
|
||||
|
7
limine.h
7
limine.h
@ -24,16 +24,21 @@ struct limine_uuid {
|
||||
uint8_t d[8];
|
||||
};
|
||||
|
||||
#define LIMINE_MEDIA_TYPE_GENERIC 0
|
||||
#define LIMINE_MEDIA_TYPE_OPTICAL 1
|
||||
#define LIMINE_MEDIA_TYPE_TFTP 2
|
||||
|
||||
struct limine_file {
|
||||
uint64_t revision;
|
||||
LIMINE_PTR(void *) address;
|
||||
uint64_t size;
|
||||
LIMINE_PTR(char *) path;
|
||||
LIMINE_PTR(char *) cmdline;
|
||||
uint64_t partition_index;
|
||||
uint32_t media_type;
|
||||
uint32_t unused;
|
||||
uint32_t tftp_ip;
|
||||
uint32_t tftp_port;
|
||||
uint32_t partition_index;
|
||||
uint32_t mbr_disk_id;
|
||||
struct limine_uuid gpt_disk_uuid;
|
||||
struct limine_uuid gpt_part_uuid;
|
||||
|
@ -106,6 +106,7 @@ static void print_file(struct limine_file *file) {
|
||||
e9_printf("File->Size: %x", file->size);
|
||||
e9_printf("File->Path: %s", file->path);
|
||||
e9_printf("File->CmdLine: %s", file->cmdline);
|
||||
e9_printf("File->MediaType: %d", file->media_type);
|
||||
e9_printf("File->PartIndex: %d", file->partition_index);
|
||||
e9_printf("File->TFTPIP: %d.%d.%d.%d",
|
||||
(file->tftp_ip & (0xff << 0)) >> 0,
|
||||
|
Loading…
Reference in New Issue
Block a user