Skip to content

Commit 49f18d5

Browse files
committed
resolve error
1 parent cb2e86f commit 49f18d5

File tree

8 files changed

+18
-8
lines changed

8 files changed

+18
-8
lines changed

Makefile

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
SHELLOBJS = shell.o ext2.o disksim.o ext2_shell.o entrylist.o
2+
3+
all: $(SHELLOBJS)
4+
$(CC) -o shell $(SHELLOBJS) -Wall
5+
6+
clean:
7+
rm *.o
8+
rm shell

disksim.o

2.45 KB
Binary file not shown.

entrylist.o

1.98 KB
Binary file not shown.

ext2.c

+10-8
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ typedef struct
66
#include "ext2.h"
77
#define MIN( a, b ) ( ( a ) < ( b ) ? ( a ) : ( b ) )
88
#define MAX( a, b ) ( ( a ) > ( b ) ? ( a ) : ( b ) )
9-
9+
int* get_data_block_at_inode(EXT2_FILESYSTEM *fs, INODE inode);
1010
int ext2_write(EXT2_NODE* file, unsigned long offset, unsigned long length, const char* buffer)
1111
{
1212
}
@@ -430,10 +430,7 @@ int find_entry_at_sector(const BYTE* sector, const BYTE* formattedName, UINT32 b
430430
EXT2_DIR_ENTRY* entry;
431431
entry = (EXT2_DIR_ENTRY*) sector;
432432
int i;
433-
434-
435-
int find_entry_on_root(EXT2_FILESYSTEM* fs, INODE inode, char* formattedName, EXT2_NODE* ret)
436-
{
433+
437434
for(i = begin; i <= last; i++)
438435
{
439436
// formattedName이 null
@@ -502,6 +499,8 @@ int find_entry_on_root(EXT2_FILESYSTEM* fs, INODE inode, char* formattedName, EX
502499
ret->location.block = 17;
503500
ret->location.group = 0;
504501
ret->location.offset = number;
502+
503+
return EXT2_SUCCESS;
505504
}
506505

507506

@@ -512,7 +511,7 @@ int find_entry_on_data(EXT2_FILESYSTEM* fs, INODE first, const BYTE* formattedNa
512511
char sector[MAX_SECTOR_SIZE];
513512
EXT2_DIR_ENTRY* entry;
514513
UINT32 number;
515-
UINT32* blockNumArr;
514+
int* blockNumArr;
516515
int i, group;
517516
group = inode / fs->sb.inode_per_group;
518517

@@ -615,11 +614,14 @@ int* get_data_block_at_inode(EXT2_FILESYSTEM *fs, INODE inode )
615614

616615
char sector4[MAX_SECTOR_SIZE];
617616

618-
int* pointer1, pointer2, pointer3, pointer4;
617+
int* pointer1;
618+
int* pointer2;
619+
int * pointer3;
620+
int * pointer4;
619621
pointer1 = (int*)sector1;
620622
pointer2 = (int*)sector2;
621623
pointer3 = (int*)sector3;
622-
pointer4= (int *)sector4;
624+
pointer4 = (int*)sector4;
623625

624626

625627

ext2.o

16.2 KB
Binary file not shown.

ext2_shell.o

12 KB
Binary file not shown.

shell

41.5 KB
Binary file not shown.

shell.o

19 KB
Binary file not shown.

0 commit comments

Comments
 (0)