Deleted Added
full compact
boot2.c (104671) boot2.c (104679)
1/*
2 * Copyright (c) 1998 Robert Nordier
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms are freely
6 * permitted provided that the above copyright notice and this
7 * paragraph and the following disclaimer are duplicated in all
8 * such forms.
9 *
10 * This software is provided "AS IS" and without any express or
11 * implied warranties, including, without limitation, the implied
12 * warranties of merchantability and fitness for a particular
13 * purpose.
14 */
15
16/*
1/*
2 * Copyright (c) 1998 Robert Nordier
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms are freely
6 * permitted provided that the above copyright notice and this
7 * paragraph and the following disclaimer are duplicated in all
8 * such forms.
9 *
10 * This software is provided "AS IS" and without any express or
11 * implied warranties, including, without limitation, the implied
12 * warranties of merchantability and fitness for a particular
13 * purpose.
14 */
15
16/*
17 * $FreeBSD: head/sys/boot/i386/boot2/boot2.c 104671 2002-10-08 10:17:16Z phk $
17 * $FreeBSD: head/sys/boot/i386/boot2/boot2.c 104679 2002-10-08 15:48:43Z phk $
18 */
19
20#include <sys/param.h>
21#include <sys/reboot.h>
22#include <sys/diskslice.h>
23#include <sys/disklabel.h>
24#include <sys/diskmbr.h>
25#include <sys/dirent.h>

--- 89 unchanged lines hidden (view full) ---

115static struct bootinfo bootinfo;
116static uint8_t ioctrl = IO_KEYBOARD;
117
118void exit(int);
119static void load(const char *);
120static int parse(char *);
121static int xfsread(ino_t, void *, size_t);
122static int dskread(void *, unsigned, unsigned);
18 */
19
20#include <sys/param.h>
21#include <sys/reboot.h>
22#include <sys/diskslice.h>
23#include <sys/disklabel.h>
24#include <sys/diskmbr.h>
25#include <sys/dirent.h>

--- 89 unchanged lines hidden (view full) ---

115static struct bootinfo bootinfo;
116static uint8_t ioctrl = IO_KEYBOARD;
117
118void exit(int);
119static void load(const char *);
120static int parse(char *);
121static int xfsread(ino_t, void *, size_t);
122static int dskread(void *, unsigned, unsigned);
123static int printf(const char *,...);
124static int putchar(int);
123static void printf(const char *,...);
124static void putchar(int);
125static uint32_t memsize(int);
126static int drvread(void *, unsigned, unsigned);
127static int keyhit(unsigned);
128static int xputc(int);
129static int xgetc(int);
130static int getc(int);
131
132#if 1

--- 397 unchanged lines hidden (view full) ---

530 }
531 dsk.start += d->d_partitions[dsk.part].p_offset;
532 dsk.start -= d->d_partitions[RAW_PART].p_offset;
533 }
534 }
535 return drvread(buf, dsk.start + lba, nblk);
536}
537
125static uint32_t memsize(int);
126static int drvread(void *, unsigned, unsigned);
127static int keyhit(unsigned);
128static int xputc(int);
129static int xgetc(int);
130static int getc(int);
131
132#if 1

--- 397 unchanged lines hidden (view full) ---

530 }
531 dsk.start += d->d_partitions[dsk.part].p_offset;
532 dsk.start -= d->d_partitions[RAW_PART].p_offset;
533 }
534 }
535 return drvread(buf, dsk.start + lba, nblk);
536}
537
538static int
538static void
539printf(const char *fmt,...)
540{
541 static const char digits[16] = "0123456789abcdef";
542 va_list ap;
543 char buf[10];
544 char *s;
545 unsigned r, u;
546 int c;

--- 21 unchanged lines hidden (view full) ---

568 while (--s >= buf)
569 putchar(*s);
570 continue;
571 }
572 }
573 putchar(c);
574 }
575 va_end(ap);
539printf(const char *fmt,...)
540{
541 static const char digits[16] = "0123456789abcdef";
542 va_list ap;
543 char buf[10];
544 char *s;
545 unsigned r, u;
546 int c;

--- 21 unchanged lines hidden (view full) ---

568 while (--s >= buf)
569 putchar(*s);
570 continue;
571 }
572 }
573 putchar(c);
574 }
575 va_end(ap);
576 return 0;
576 return;
577}
578
577}
578
579static int
579static void
580putchar(int c)
581{
582 if (c == '\n')
583 xputc('\r');
580putchar(int c)
581{
582 if (c == '\n')
583 xputc('\r');
584 return xputc(c);
584 xputc(c);
585}
586
587static uint32_t
588memsize(int type)
589{
590 v86.addr = type;
591 v86.eax = 0x8800;
592 v86int();

--- 77 unchanged lines hidden ---
585}
586
587static uint32_t
588memsize(int type)
589{
590 v86.addr = type;
591 v86.eax = 0x8800;
592 v86int();

--- 77 unchanged lines hidden ---