multiple topics (Higher Half and LFB, VFS and HAL)
Posted: Thu Jul 23, 2015 10:36 am
Ok, so I haven't wanted to ask any of these questions by them self so I decided to compile a list and ask all at once.
1) In a higher half kernel mapped at 0xC0000000 (actually 0xC0010000 - 0xC0020000 for kernel and modules), but I have LFB enabled which in my case starts at 0xC0000000 or 0xF8000000 depending on my test system in use. So I have to know if the LFB uses physical or virtual addresses to pull the data, I read that you can do a page flip buffer on the LFB, so it seems like it uses virtual addresses to me.
So the first question is, How would I setup a higher-half kernel over 3GB if the video buffer can be anywhere over 3GB? Or can I change the LFB location?
2) This is probably more of an opinion on design rather than facts. Currently my HAL is the only communication to the "outside" world (outside of CPU that is), and my VFS is a HAL device. The VFS keeps track of partitions (max 255) and file systems (again 255 max).
HAL and VFS Structures:
The file system table is HAL_t[256].
So the HAL is called with an open command for the VFS passing FILE* File and char* Path, from there it checks the partition for a file system, if the driver exists it passes *Path+3 to the file system to locate the file. The File System driver calls HAL_read/HAL_write for the HALid File->Partition->HALid with offset of File->Partition->PartOffset and Device id File->Partiton->Subid (for multiple drives controlled by one driver, such as up to 4 FDC's and 4 HDD's PATA)
I am currently debating of separating HAL and VFS as I've had it in my previous revision. Which would allow me to also have a Partition Read/Write function to avoid more hassle with the FS Drivers - which I could do with another HAL device, though it seems like too many layers - but I see this getting in the way if say I wanted to run a FS over UART or CAT5 or even if I wanted to be crazy Video Buffer.
So my second question, which is not really a question but asking for opinion, What would be YOUR recommendation for HAL and VFS?
I'm not looking for posix at all, in fact I want to avoid it as much as possible.
Thanks for your time, and hopefully that was all legible
1) In a higher half kernel mapped at 0xC0000000 (actually 0xC0010000 - 0xC0020000 for kernel and modules), but I have LFB enabled which in my case starts at 0xC0000000 or 0xF8000000 depending on my test system in use. So I have to know if the LFB uses physical or virtual addresses to pull the data, I read that you can do a page flip buffer on the LFB, so it seems like it uses virtual addresses to me.
So the first question is, How would I setup a higher-half kernel over 3GB if the video buffer can be anywhere over 3GB? Or can I change the LFB location?
2) This is probably more of an opinion on design rather than facts. Currently my HAL is the only communication to the "outside" world (outside of CPU that is), and my VFS is a HAL device. The VFS keeps track of partitions (max 255) and file systems (again 255 max).
HAL and VFS Structures:
Code: Select all
typedef struct PARTITION_STRUCT { //32Bytes
uint8_t HALid;
uint8_t Subid;
uint8_t FSid;
uint8_t flags;
uint64_t PartOffset;
uint64_t PartSize;
char name[12];
}__attribute__((packed)) Part_t, *Part_p;
typedef struct FILE_STRUCT { //64Bytes
Part_p Partition;
uint32_t Current;
uint32_t Position;
uint32_t FileSize;
uint8_t flags;
char name[47];
}__attribute__((packed)) FILE;
typedef struct HAL_DEVICE { // 32Bytes per Entry
void (*open)(void*, void*, void*, void*);
void (*read)(void*, void*, void*, void*);
void (*write)(void*, void*, void*, void*);
void (*install)(void*, void*, void*, void*);
void (*uninstall)(void*, void*, void*, void*);
void (*close)(void*, void*, void*, void*);
char name[8];
}__attribute__((packed)) HAL_t, *HAL_p;
So the HAL is called with an open command for the VFS passing FILE* File and char* Path, from there it checks the partition for a file system, if the driver exists it passes *Path+3 to the file system to locate the file. The File System driver calls HAL_read/HAL_write for the HALid File->Partition->HALid with offset of File->Partition->PartOffset and Device id File->Partiton->Subid (for multiple drives controlled by one driver, such as up to 4 FDC's and 4 HDD's PATA)
I am currently debating of separating HAL and VFS as I've had it in my previous revision. Which would allow me to also have a Partition Read/Write function to avoid more hassle with the FS Drivers - which I could do with another HAL device, though it seems like too many layers - but I see this getting in the way if say I wanted to run a FS over UART or CAT5 or even if I wanted to be crazy Video Buffer.
So my second question, which is not really a question but asking for opinion, What would be YOUR recommendation for HAL and VFS?
I'm not looking for posix at all, in fact I want to avoid it as much as possible.
Thanks for your time, and hopefully that was all legible