summaryrefslogtreecommitdiff
path: root/bootblocks
diff options
context:
space:
mode:
authorRobert de Bath <rdebath@poboxes.com>2002-01-12 20:42:42 +0100
committerLubomir Rintel <lkundrak@v3.sk>2013-10-23 23:48:46 +0200
commitd91fa39567f5659e3931cf61517d62fddcd87570 (patch)
tree20583acd4f345a4f5c9a7772870ef972cb8a3b14 /bootblocks
parentbff547eabb6678ec8e71ffbcfbf9a4f05c94d949 (diff)
downloaddev86-d91fa39567f5659e3931cf61517d62fddcd87570.tar.gz
Import Dev86src-0.16.1.tar.gzv0.16.1
Diffstat (limited to 'bootblocks')
-rw-r--r--bootblocks/Makefile10
-rw-r--r--bootblocks/cprintf.c150
-rw-r--r--bootblocks/mbr.s2
-rw-r--r--bootblocks/monitor.h2
-rw-r--r--bootblocks/tarboot.s14
5 files changed, 10 insertions, 168 deletions
diff --git a/bootblocks/Makefile b/bootblocks/Makefile
index f54305d..66a87c4 100644
--- a/bootblocks/Makefile
+++ b/bootblocks/Makefile
@@ -25,9 +25,9 @@ encap: $(SSRC:s=v) $(CSRC:c=v) minixhd.v msdos16.v
bootbin: $(SSRC:s=bin) $(CSRC:c=bin) minixhd.bin msdos16.bin minix_elks.bin
MOBJ=monitor.o commands.o i86_funcs.o relocate.o help.o bzimage.o \
- trk_buf.o min_buf.o unix.o fs.o fs_tar.o fs_min.o fs_dos.o cprintf.o
+ trk_buf.o min_buf.o unix.o fs.o fs_tar.o fs_min.o fs_dos.o
MSRC=monitor.c commands.c i86_funcs.c relocate.c help.c bzimage.c \
- trk_buf.c min_buf.c unix.c fs.c fs_tar.c fs_min.c fs_dos.c cprintf.c
+ trk_buf.c min_buf.c unix.c fs.c fs_tar.c fs_min.c fs_dos.c
MINC=i86_funcs.h readfs.h monitor.h
BOOTBLOCKS=sysboot.v noboot.v skip.v msdos.v msdos16.v \
@@ -46,19 +46,19 @@ fs_min.o: minix.h
bootfile.sys: $(MSRC) $(MINC)
@rm -f $(MOBJ)
- make 'CFLAGS=$(CFLAGS) -DDOSFLOPPY -i-' monitor.out
+ make 'CFLAGS=$(CFLAGS) -DDOSFLOPPY -i' monitor.out
mv monitor.out bootfile.sys
@rm -f $(MOBJ)
boottar.sys: $(MSRC) $(MINC) tarboot.bin
@rm -f $(MOBJ)
- make 'CFLAGS=$(CFLAGS) -DTARFLOPPY -i-' monitor.out
+ make 'CFLAGS=$(CFLAGS) -DTARFLOPPY -i' monitor.out
mv monitor.out boottar.sys
@rm -f $(MOBJ)
bootminix.sys: $(MSRC) $(MINC) tarboot.bin
@rm -f $(MOBJ)
- make 'CFLAGS=$(CFLAGS) -DMINFLOPPY -i-' monitor.out
+ make 'CFLAGS=$(CFLAGS) -DMINFLOPPY -i' monitor.out
mv monitor.out bootminix.sys
@rm -f $(MOBJ)
diff --git a/bootblocks/cprintf.c b/bootblocks/cprintf.c
deleted file mode 100644
index e6c0ea7..0000000
--- a/bootblocks/cprintf.c
+++ /dev/null
@@ -1,150 +0,0 @@
-
-#include <stdarg.h>
-
-static unsigned char * __numout(long i, int base);
-
-cputchar(ch)
-int ch;
-{
- if(ch == '\n') bios_putc('\r');
- return bios_putc(ch);
-}
-
-cprintf(char * fmt, ...)
-{
- register int c;
- int count = 0;
- int type, base;
- long val;
- char * cp;
- char padch=' ';
- int minsize, maxsize;
- va_list ap;
-
- va_start(ap, fmt);
-
- while(c=*fmt++)
- {
- count++;
- if(c!='%')
- cputchar(c);
- else
- {
- type=1;
- padch = *fmt;
- maxsize=minsize=0;
- if(padch == '-') fmt++;
-
- for(;;)
- {
- c=*fmt++;
- if( c<'0' || c>'9' ) break;
- minsize*=10; minsize+=c-'0';
- }
-
- if( c == '.' )
- for(;;)
- {
- c=*fmt++;
- if( c<'0' || c>'9' ) break;
- maxsize*=10; maxsize+=c-'0';
- }
-
- if( padch == '-' ) minsize = -minsize;
- else
- if( padch == '0' ) padch='0'; else padch=' ';
-
- if( c == 0 ) break;
- if(c=='h')
- {
- c=*fmt++;
- type = 0;
- }
- else if(c=='l')
- {
- c=*fmt++;
- type = 2;
- }
-
- switch(c)
- {
- case 'x': base=16; type |= 4; if(0) {
- case 'o': base= 8; type |= 4; } if(0) {
- case 'u': base=10; type |= 4; } if(0) {
- case 'd': base=10; }
- switch(type)
- {
- case 0: val=va_arg(ap, short); break;
- case 1: val=va_arg(ap, int); break;
- case 2: val=va_arg(ap, long); break;
- case 4: val=va_arg(ap, unsigned short); break;
- case 5: val=va_arg(ap, unsigned int); break;
- case 6: val=va_arg(ap, unsigned long); break;
- default:val=0; break;
- }
- cp = __numout(val,base);
- if(0) {
- case 's':
- cp=va_arg(ap, char *);
- }
- count--;
- c = strlen(cp);
- if( !maxsize ) maxsize = c;
- if( minsize > 0 )
- {
- minsize -= c;
- while(minsize>0) { cputchar(padch); count++; minsize--; }
- minsize=0;
- }
- if( minsize < 0 ) minsize= -minsize-c;
- while(*cp && maxsize-->0 )
- {
- cputchar(*cp++);
- count++;
- }
- while(minsize>0) { cputchar(' '); count++; minsize--; }
- break;
- case 'c':
- cputchar(va_arg(ap, int));
- break;
- default:
- cputchar(c);
- break;
- }
- }
- }
- va_end(ap);
- return count;
-}
-
-static char nstring[]="0123456789ABCDEF";
-
-static unsigned char *
-__numout(long i, int base)
-{
- static unsigned char out[16];
- int n;
- int flg = 0;
- unsigned long val;
-
- if (i<0 && base==10)
- {
- flg = 1;
- i = -i;
- }
- val = i;
-
- for (n = 0; n < 15; n++)
- out[n] = ' ';
- out[15] = '\0';
- n = 14;
- do
- {
- out[n] = nstring[val % base];
- n--;
- val /= base;
- }
- while(val);
- if(flg) out[n--] = '-';
- return &out[n+1];
-}
diff --git a/bootblocks/mbr.s b/bootblocks/mbr.s
index 113bb51..d071a8b 100644
--- a/bootblocks/mbr.s
+++ b/bootblocks/mbr.s
@@ -16,7 +16,7 @@
ORGADDR=$0500
preboot=0 ! Include the pre-boot loader.
mbrkey=0 ! Option to choose the boot record base on keystroke
-message=0 ! Display boot message
+message=1 ! Display boot message
diskman=0 ! Disk manager partitions, allows 16 partitions but
! don't overwrite this with a LILO BB.
diff --git a/bootblocks/monitor.h b/bootblocks/monitor.h
index 7283c10..9d66f95 100644
--- a/bootblocks/monitor.h
+++ b/bootblocks/monitor.h
@@ -59,7 +59,7 @@ extern union REGS __argr;
#ifdef __STANDALONE__
#undef putchar
-#define putchar cputchar
+#define putchar putch
#define printf cprintf
#define fflush(x)
#endif
diff --git a/bootblocks/tarboot.s b/bootblocks/tarboot.s
index f872ad0..a8e56fa 100644
--- a/bootblocks/tarboot.s
+++ b/bootblocks/tarboot.s
@@ -463,28 +463,20 @@ bad_rt: xor ah,ah
if DEBUG
pboot:
- mov si,#mesg
+ mov si,#blk_load
nextc:
lodsb
call putc
cmp al,#0
jnz nextc
ret
-
-locn(512-16)
-mesg:
-.ascii "Tarboot loading "
endif
!-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
-! This isn't a hard disk boot sector so don't give it an HD magic
-! locn(510)
-! .word 0xAA55
-if DEBUG = 0
+! This isn't a hard disk boot sector but give it an HD magic anyway.
locn(510)
- .word 0
-endif
+ .word 0xAA55
! From here down is where we load stuff.
locn(512)