Skip to content

Commit d22f1bf

Browse files
committed
* partially implemented path naming
1 parent 0401d11 commit d22f1bf

File tree

3 files changed

+37
-2
lines changed

3 files changed

+37
-2
lines changed

Filesystem/FATFS.cpp

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@
33
void printf(char*);
44
void printHex(uint8_t Key);
55

6+
char *PATH;
7+
char *lst_dir;
8+
char *lst_dir2;
9+
int PATHIndex = 0;
10+
611
void ReadBiosBlock(AdvancedTechnologyAttachment *hd, uint32_t partitionOffset)
712
{
813
BiosParameterBlock32 bpb;
@@ -36,7 +41,37 @@ void ReadBiosBlock(AdvancedTechnologyAttachment *hd, uint32_t partitionOffset)
3641
printf(foo);
3742

3843
if ((dirent[i].attributes & 0x10) == 0x10) // directory
44+
{
45+
int ZERO = 0;
46+
47+
if (lst_dir2 == (char*)dirent[i].name)
48+
{
49+
continue;
50+
}
51+
else
52+
{
53+
if (lst_dir == (char *)dirent[i].name)
54+
{
55+
continue;
56+
}
57+
else
58+
{
59+
for (int x = 0; dirent[i].name[x] != ' ' && x < 8; x++)
60+
{
61+
PATH[PATHIndex] = dirent[i].name[x];
62+
PATHIndex++;
63+
}
64+
PATH[PATHIndex] = '/';
65+
PATHIndex++;
66+
printf("\nPATH: ");
67+
printf(PATH);
68+
printf("\n");
69+
}
70+
}
71+
lst_dir2 = lst_dir;
72+
lst_dir = (char *)dirent[i].name;
3973
continue;
74+
}
4075

4176
uint32_t firstFileCluster = ((uint32_t)dirent[i].firstClusterHi) << 16 | ((uint32_t)dirent[i].firstClusterLow);
4277

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ prep:
4343

4444
SectorOS_Kernel.bin: LILO/linker.ld $(objects)
4545
@printf "\e[1;33m[2/3]Linking object files\n\e[0m"
46-
@$(ld) $(LDFLAGS) -T $< -o $@ $(objects)
46+
@$(LD) $(LDFLAGS) -T $< -o $@ $(objects)
4747
@printf "Linking $(objects) to make $@\n"
4848
@printf "Linking finished\n"
4949

kernel/kernel.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1125,7 +1125,7 @@ extern "C" void kernelMain(const void *multiboot_structure, uint32_t multiboot_m
11251125

11261126
printf("Allocating Memory....\n");
11271127
PrintMEM(multiboot_structure);
1128-
PrintPartitions();
1128+
//PrintPartitions();
11291129
sp.logToSerialPort("\nHardware initialising stage 3 finished");
11301130
detect_cpu();
11311131

0 commit comments

Comments
 (0)