URL
https://opencores.org/ocsvn/eco32/eco32/trunk
Subversion Repositories eco32
Compare Revisions
- This comparison shows the changes necessary to convert path
/eco32/trunk/stdalone/mkpart
- from Rev 245 to Rev 259
- ↔ Reverse comparison
Rev 245 → Rev 259
/dump/Makefile
9,7 → 9,7
install: dump |
|
dump: dump.c |
gcc -m32 -g -Wall -o dump dump.c |
gcc -g -Wall -o dump dump.c |
|
clean: |
rm -f *~ dump |
/main.c
132,12 → 132,12
} |
|
|
unsigned long getDiskSize(void) { |
unsigned int getDiskSize(void) { |
return *DISK_CAP; |
} |
|
|
Bool readDisk(unsigned long sector, |
Bool readDisk(unsigned int sector, |
unsigned int count, |
unsigned int *addr) { |
unsigned int n; |
164,7 → 164,7
} |
|
|
Bool writeDisk(unsigned long sector, |
Bool writeDisk(unsigned int sector, |
unsigned int count, |
unsigned int *addr) { |
unsigned int n; |
195,7 → 195,7
|
|
void main(void) { |
unsigned long numSectors; |
unsigned int numSectors; |
|
/* init interrupts */ |
initInterrupts(); |
205,7 → 205,7
} |
/* determine disk size */ |
numSectors = getDiskSize(); |
printf("Disk has %lu (0x%lX) sectors.\n", |
printf("Disk has %u (0x%X) sectors.\n", |
numSectors, numSectors); |
if (numSectors < 32) { |
error("disk is too small"); |
/mkmboot/stage2/mboot.c
23,9 → 23,9
|
|
typedef struct { |
unsigned long type; |
unsigned long start; |
unsigned long size; |
unsigned int type; |
unsigned int start; |
unsigned int size; |
char descr[DESCR_SIZE]; |
} PartEntry; |
|
102,8 → 102,8
} |
|
|
int countPrintn(long n) { |
long a; |
int countPrintn(int n) { |
int a; |
int res; |
|
res = 0; |
119,8 → 119,8
} |
|
|
void printn(long n) { |
long a; |
void printn(int n) { |
int a; |
|
if (n < 0) { |
putchar('-'); |
/idedsk.h
17,12 → 17,12
#define DISK_CAP (DISK_BASE + 3) /* disk capacity register */ |
#define DISK_BUFFER ((unsigned *) 0xF0480000) /* address of disk buffer */ |
|
#define DISK_CTRL_STRT 0x01 /* a 1 written here starts the disk command */ |
#define DISK_CTRL_IEN 0x02 /* enable disk interrupt */ |
#define DISK_CTRL_WRT 0x04 /* command type: 0 = read, 1 = write */ |
#define DISK_CTRL_ERR 0x08 /* 0 = ok, 1 = error; valid when DONE = 1 */ |
#define DISK_CTRL_DONE 0x10 /* 1 = disk has finished the command */ |
#define DISK_CTRL_READY 0x20 /* 1 = capacity valid, disk accepts command */ |
#define DISK_CTRL_STRT 0x01U /* a 1 written here starts the disk command */ |
#define DISK_CTRL_IEN 0x02U /* enable disk interrupt */ |
#define DISK_CTRL_WRT 0x04U /* command type: 0 = read, 1 = write */ |
#define DISK_CTRL_ERR 0x08U /* 0 = ok, 1 = error; valid when DONE = 1 */ |
#define DISK_CTRL_DONE 0x10U /* 1 = disk has finished the command */ |
#define DISK_CTRL_READY 0x20U /* 1 = capacity valid, disk accepts command */ |
|
#define DISK_IRQ 8 /* disk interrupt number */ |
|
/mkptbl/mkptbl.c
17,9 → 17,9
|
|
typedef struct { |
unsigned long type; |
unsigned long start; |
unsigned long size; |
unsigned int type; |
unsigned int start; |
unsigned int size; |
char descr[DESCR_SIZE]; |
} PartEntry; |
|
38,7 → 38,7
} |
|
|
void convertNumber(unsigned char *p, unsigned long val) { |
void convertNumber(unsigned char *p, unsigned int val) { |
*(p + 0) = val >> 24; |
*(p + 1) = val >> 16; |
*(p + 2) = val >> 8; |
59,10 → 59,10
} |
|
|
int parseNumber(char **pc, unsigned long *pi) { |
int parseNumber(char **pc, unsigned int *pi) { |
char *p; |
unsigned int base, dval; |
unsigned long n; |
unsigned int n; |
|
p = *pc; |
while (*p == ' ' || *p == '\t') { |
150,12 → 150,12
char line[LINE_SIZE]; |
char *p; |
int lineNumber; |
unsigned long partNum; |
unsigned long bootable; |
unsigned long partType; |
unsigned long partStart; |
unsigned long partLast; |
unsigned long partSize; |
unsigned int partNum; |
unsigned int bootable; |
unsigned int partType; |
unsigned int partStart; |
unsigned int partLast; |
unsigned int partSize; |
char descr[LINE_SIZE]; |
|
/* check command line arguments */ |
251,7 → 251,7
} else { |
partLast = 0; |
} |
printf("%2lu %s 0x%08lX 0x%08lX 0x%08lX 0x%08lX %s\n", |
printf("%2u %s 0x%08X 0x%08X 0x%08X 0x%08X %s\n", |
partNum, |
ptr[partNum].type & 0x80000000 ? "*" : " ", |
ptr[partNum].type & 0x7FFFFFFF, |
/mkptbl/Makefile
8,7 → 8,7
./mkptbl disk.part parttbl |
|
mkptbl: mkptbl.c |
gcc -m32 -g -Wall -o mkptbl mkptbl.c |
gcc -g -Wall -o mkptbl mkptbl.c |
|
clean: |
rm -f *~ mkptbl parttbl |