and fixed some errors.
#include "core.h"
#include "cache.h"
-#include "disk.h"
#include <stdio.h>
#include <string.h>
/* let's find it from the end, 'cause the endest is the freshest */
struct cache_struct *cs = cache_head.prev;
struct cache_struct *head, *last;
- uint32_t block = regs->eax.l;
+ block_t block = regs->eax.l;
int i;
static int total_read;
#include <stdint.h>
#include <com32.h>
-
+#include "disk.h"
#define MAX_CACHE_ENTRIES 0x064 /* I'm not sure it's the max */
-
-
/* The cache structure */
struct cache_struct {
- uint32_t block;
+ block_t block;
struct cache_struct *prev;
struct cache_struct *next;
void *data;
};
-
/* functions defined in cache.c */
void cache_init(com32sys_t *regs);
#include "core.h"
#include "disk.h"
-void read_sectors(char *buf, int sector_num, int sectors)
+void read_sectors(char *buf, sector_t sector_num, int sectors)
{
com32sys_t regs;
}
-void getoneblk(char *buf, uint32_t block, int block_size)
+void getoneblk(char *buf, block_t block, int block_size)
{
int sec_per_block = block_size >> SECTOR_SHIFT;
/* hello.c */
extern void myputs(const char*);
-/* cache.c */
-extern void read_sectors(char *, int, int);
-extern void get_cache_block(com32sys_t *);
-
void __cdecl core_intcall(uint8_t, const com32sys_t *, com32sys_t *);
void __cdecl core_farcall(uint32_t, const com32sys_t *, com32sys_t *);
#define SECTOR_SHIFT 9
#define SECTOR_SIZE (1 << SECTOR_SHIFT)
+typedef unsigned int sector_t;
+typedef unsigned int block_t;
-extern void read_sectors(char *, int, int);
-extern void get_cache_block(com32sys_t *);
+extern void read_sectors(char *, sector_t, int);
+extern void getoneblk(char *, block_t, int);
#endif /* DISK_H */