Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ VMLINUXGZ = $(KSRC)/arch/alpha/boot/vmlinux.gz
#TESTING = yes

# for boot testing
#CFGDEFS = -DDEBUG_ISO -DDEBUG_ROCK -DDEBUG_EXT2 -DDEBUG
#CFGDEFS = -DDEBUG_ISO -DDEBUG_ROCK -DDEBUG_EXT2 -DDEBUG_XFS -DDEBUG

# root, aka prefix
root =
Expand Down Expand Up @@ -57,7 +57,7 @@ override ASFLAGS += $(CPPFLAGS)
$(CC) $(ASFLAGS) -D__ASSEMBLY__ -c -o $*.o $<

NET_OBJS = net.o
DISK_OBJS = disk.o fs/ext2.o fs/ufs.o fs/dummy.o fs/iso.o
DISK_OBJS = disk.o fs/ext2.o fs/ufs.o fs/dummy.o fs/iso.o fs/xfs.o
ifeq ($(TESTING),)
ABOOT_OBJS = \
head.o aboot.o cons.o utils.o \
Expand Down
29 changes: 13 additions & 16 deletions disk.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,16 @@ extern struct bootfs ext2fs;
extern struct bootfs iso;
extern struct bootfs ufs;
extern struct bootfs dummyfs;
extern struct bootfs xfsfs;

struct disklabel * label;
int boot_part = -1;

static const struct bootfs *bootfs[] = {
&ext2fs,
&iso,
&ufs
&ufs,
&xfsfs
};

/*
Expand Down Expand Up @@ -326,23 +328,18 @@ mount_fs (long dev, int partition)
return 0;
}
part = &label->d_partitions[partition - 1];
for (i = 0; bootfs[i]->fs_type != part->p_fstype; ++i) {
if (i + 1
>= (int) (sizeof(bootfs)/sizeof(bootfs[0])))
{
printf("aboot: don't know how to mount "
"partition %d (filesystem type %d)\n",
partition, part->p_fstype);
return 0;
for (i = 0; i < (int)(sizeof(bootfs)/sizeof(bootfs[0])); i++) {
if (bootfs[i]->fs_type == part->p_fstype) {
fs = bootfs[i];
if (!((*fs->mount)(dev, (long)(part->p_offset) * (long)(label->d_secsize), 1)
< 0))
return fs;
}
}
fs = bootfs[i];
if ((*fs->mount)(dev, (long)(part->p_offset) * (long)(label->d_secsize), 0)
< 0) {
printf("aboot: mount of partition %d failed\n",
partition);
return 0;
}
printf("aboot: don't know how to mount "
"partition %d (filesystem type %d)\n",
partition, part->p_fstype);
return 0;
}
return fs;
}
Expand Down
Loading