-
Notifications
You must be signed in to change notification settings - Fork 0
Internals 101
How VDK Works is similar to NT. Let me explain:
There is essentially 2 modes for the OS to work in:
- Native
- v32
Native is bare bones kernel mode. The mode that the kernel panic is in, essentially.
v32 is where all apps operate in, it's more restricted than kernel mode. Your desktop, apps, everything you use is in v32 mode. It uses the v32 API and syscalls.
You can use Native mode for something like a GUI-Free mode, although it's very hard to get in without modifying source. In layman's terms:
- Native: MS-DOS
- v32: Normal OS
Via Dynamic File System is a file system developed at Via Operating. Mainly used for vOS.
Everything, from files to folders, is stored as entries on disk:
typedef struct
{
char Name[11]; // 8.3 format
uint8_t Attributes;
bool IsDirectory;
uint32_t Position;
uint32_t FirstSector; // First sector, which sector data is stored in
} VD_Entry;
(F1.1, osfs/fs.h)
It has a name, in the 8.3 format (8 characters for name, 3 for extension), Attributes (See Figure 1.2), If it's a directory or not, It's position (Place of file, if it's 0 then its first file on disk...), and the sector it's stored in.
File data is stored in the sector or cluster after the entry structure.
enum VD_Attributes
{
VD_ATTRIBUTE_READ_ONLY = 0x01,
VD_ATTRIBUTE_HIDDEN = 0x02,
VD_ATTRIBUTE_SYSTEM = 0x04,
VD_ATTRIBUTE_DIRECTORY = 0x10,
VD_ATTRIBUTE_ARCHIVE = 0x20,
VD_ATTRIBUTE_NONE = 0x00
};
(F1.2, osfs/fs.h)
This are all the attributes for entries on disk.
VD_Entry VD_Open(const char* path);
VD_Entry VD_Read(uint32_t sector);
bool VD_Write(VD_Entry file);
bool VD_WriteData(char* data, VD_Entry file);
void VD_ReadData(const char* path, char* out);
(F1.3, osfs/fs.h)
These are all functions for VDFS.