summaryrefslogtreecommitdiff
path: root/package/aboot/src/fs/iso.c
blob: 764993c05c14995602da5e4925e860aa771ebe9c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
/* 
 * This code is based on the ISO filesystem support in MILO (by
 * Dave Rusling).
 *
 * This is a set of functions that provides minimal filesystem
 * functionality to the Linux bootstrapper.  All we can do is
 * open and read files... but that's all we need 8-)
 */
#include <stddef.h>
#include <cons.h>
#include <bootfs.h>
#include <isolib.h>

#ifdef DEBUG_ISO
#include <utils.h>
#endif

extern const struct bootfs isofs;

static long cd_device = -1;


long
iso_dev_read (void * buf, long offset, long size)
{
	return cons_read(cd_device, buf, size, offset);
}


static int
iso_mount (long cons_dev, long p_offset, long quiet)
{
#ifdef DEBUG_ISO 
	printf("iso_mount() called\n");
#endif	
	cd_device = cons_dev;
	/*
	 * Read the super block (this determines the file system type
	 * and other important information)
	 */
	return iso_read_super(NULL, quiet);
}

static const char *
iso_readdir(int fd, int rewind)
{
	return iso_readdir_i(fd,rewind); 
}

const struct bootfs iso = {
  -1,	/* isofs is not partitioned */
  1024,	/* block size */
  iso_mount,
  iso_open,
  iso_bread,
  iso_close,
  iso_readdir,
  iso_fstat
};