user_thread #9

Merged
mathieu merged 12 commits from user_thread into master 2024-02-28 20:24:14 +01:00
3 changed files with 15 additions and 1 deletions
Showing only changes of commit 9713f527a8 - Show all commits

View File

@ -46,7 +46,7 @@ void idleThread(void *arg)
#define FILE_MAX_SIZE 64 // In nb of sectors
void loadUserSpace()
{
struct ata_partition *part = ATAGetPartition(1);
struct ata_partition *part = ATAGetPartitionByType(PART_TYPE_LINUX);
if (part == NULL) {
printf("No user partition found\n");

View File

@ -521,6 +521,19 @@ struct ata_partition *ATAGetPartition(int id)
return NULL;
}
struct ata_partition *ATAGetPartitionByType(uint type)
{
struct ata_partition *part;
int count;
list_foreach(partitions, part, count)
{
if (part->type == type)
return part;
}
return NULL;
}
struct ata_partition *ATAPartitionCreate(uint type, uint size, uint32_t lba,
struct ata_device *dev)
{

View File

@ -104,5 +104,6 @@ int ATAReadPartitionSector(struct ata_partition *part, int offset, uint nbSector
int ATAReadSector(struct ata_device *dev, int lba, uint nbSector, void *buf);
int ATAWriteSector(struct ata_device *dev, int lba, uint nbSector, void *buf);
struct ata_device *ATAGetDevice(int ctlId, int devId);
struct ata_partition *ATAGetPartitionByType(uint type);
int ATAReadPartition(struct ata_device *dev);
struct ata_partition *ATAGetPartition(int id);