head	1.2;
access;
symbols
	perseant-exfatfs-base-20250801:1.2
	perseant-exfatfs-base-20240630:1.2
	perseant-exfatfs:1.2.0.48
	perseant-exfatfs-base:1.2
	cjep_sun2x:1.2.0.46
	cjep_sun2x-base:1.2
	cjep_staticlib_x-base1:1.2
	cjep_staticlib_x:1.2.0.44
	cjep_staticlib_x-base:1.2
	phil-wifi-20200421:1.2
	phil-wifi-20200411:1.2
	phil-wifi-20200406:1.2
	pgoyette-compat-merge-20190127:1.2
	pgoyette-compat-20190127:1.2
	pgoyette-compat-20190118:1.2
	pgoyette-compat-1226:1.2
	pgoyette-compat-1126:1.2
	pgoyette-compat-1020:1.2
	pgoyette-compat-0930:1.2
	pgoyette-compat-0906:1.2
	pgoyette-compat-0728:1.2
	pgoyette-compat-0625:1.2
	pgoyette-compat-0521:1.2
	pgoyette-compat-0502:1.2
	pgoyette-compat-0422:1.2
	pgoyette-compat-0415:1.2
	pgoyette-compat-0407:1.2
	pgoyette-compat-0330:1.2
	pgoyette-compat-0322:1.2
	pgoyette-compat-0315:1.2
	pgoyette-compat:1.2.0.42
	pgoyette-compat-base:1.2
	perseant-stdc-iso10646:1.2.0.40
	perseant-stdc-iso10646-base:1.2
	prg-localcount2-base3:1.2
	prg-localcount2-base2:1.2
	prg-localcount2-base1:1.2
	prg-localcount2:1.2.0.38
	prg-localcount2-base:1.2
	pgoyette-localcount-20170426:1.2
	bouyer-socketcan-base1:1.2
	pgoyette-localcount-20170320:1.2
	bouyer-socketcan:1.2.0.36
	bouyer-socketcan-base:1.2
	pgoyette-localcount-20170107:1.2
	pgoyette-localcount-20161104:1.2
	localcount-20160914:1.2
	pgoyette-localcount-20160806:1.2
	pgoyette-localcount-20160726:1.2
	pgoyette-localcount:1.2.0.34
	pgoyette-localcount-base:1.2
	netbsd-5-2-3-RELEASE:1.2
	netbsd-5-1-5-RELEASE:1.2
	yamt-pagecache-base9:1.2
	yamt-pagecache-tag8:1.2
	tls-earlyentropy:1.2.0.30
	tls-earlyentropy-base:1.2
	riastradh-xf86-video-intel-2-7-1-pre-2-21-15:1.2
	riastradh-drm2-base3:1.2
	netbsd-5-2-2-RELEASE:1.2
	netbsd-5-1-4-RELEASE:1.2
	netbsd-5-2-1-RELEASE:1.2
	netbsd-5-1-3-RELEASE:1.2
	agc-symver:1.2.0.32
	agc-symver-base:1.2
	tls-maxphys-base:1.2
	yamt-pagecache-base8:1.2
	netbsd-5-2:1.2.0.28
	yamt-pagecache-base7:1.2
	netbsd-5-2-RELEASE:1.2
	netbsd-5-2-RC1:1.2
	yamt-pagecache-base6:1.2
	yamt-pagecache-base5:1.2
	yamt-pagecache-base4:1.2
	netbsd-5-1-2-RELEASE:1.2
	netbsd-5-1-1-RELEASE:1.2
	yamt-pagecache-base3:1.2
	yamt-pagecache-base2:1.2
	yamt-pagecache:1.2.0.26
	yamt-pagecache-base:1.2
	bouyer-quota2-nbase:1.2
	bouyer-quota2:1.2.0.24
	bouyer-quota2-base:1.2
	matt-nb5-pq3:1.2.0.22
	matt-nb5-pq3-base:1.2
	netbsd-5-1:1.2.0.20
	netbsd-5-1-RELEASE:1.2
	netbsd-5-1-RC4:1.2
	netbsd-5-1-RC3:1.2
	netbsd-5-1-RC2:1.2
	netbsd-5-1-RC1:1.2
	netbsd-5-0-2-RELEASE:1.2
	netbsd-5-0-1-RELEASE:1.2
	jym-xensuspend-nbase:1.2
	netbsd-5-0:1.2.0.18
	netbsd-5-0-RELEASE:1.2
	netbsd-5-0-RC4:1.2
	netbsd-5-0-RC3:1.2
	netbsd-5-0-RC2:1.2
	jym-xensuspend:1.2.0.16
	jym-xensuspend-base:1.2
	netbsd-5-0-RC1:1.2
	netbsd-5:1.2.0.14
	netbsd-5-base:1.2
	yamt-pf42-base4:1.2
	yamt-pf42-base3:1.2
	hpcarm-cleanup-nbase:1.2
	yamt-pf42-base2:1.2
	yamt-pf42:1.2.0.12
	yamt-pf42-base:1.2
	mjf-devfs2:1.2.0.10
	mjf-devfs2-base:1.2
	keiichi-mipv6:1.2.0.8
	keiichi-mipv6-base:1.2
	cube-autoconf:1.2.0.6
	cube-autoconf-base:1.2
	mjf-devfs:1.2.0.4
	mjf-devfs-base:1.2
	hpcarm-cleanup:1.2.0.2
	hpcarm-cleanup-base:1.2
	netbsd-1-5-PATCH003:1.1
	netbsd-1-5-PATCH002:1.1
	netbsd-1-5-PATCH001:1.1
	netbsd-1-5-RELEASE:1.1
	netbsd-1-5-BETA2:1.1
	netbsd-1-5-BETA:1.1
	netbsd-1-4-PATCH003:1.1
	netbsd-1-5-ALPHA2:1.1
	netbsd-1-5:1.1.0.12
	netbsd-1-5-base:1.1
	minoura-xpg4dl:1.1.0.10
	minoura-xpg4dl-base:1.1
	netbsd-1-4-PATCH002:1.1
	wrstuden-devbsize-19991221:1.1
	wrstuden-devbsize:1.1.0.8
	wrstuden-devbsize-base:1.1
	comdex-fall-1999:1.1.0.6
	comdex-fall-1999-base:1.1
	netbsd-1-4-PATCH001:1.1
	netbsd-1-4-RELEASE:1.1
	netbsd-1-4:1.1.0.4
	netbsd-1-4-base:1.1
	netbsd-1-3-PATCH003:1.1
	netbsd-1-3-PATCH003-CANDIDATE2:1.1
	netbsd-1-3-PATCH003-CANDIDATE1:1.1
	netbsd-1-3-PATCH003-CANDIDATE0:1.1
	netbsd-1-3-PATCH002:1.1
	netbsd-1-3-PATCH001:1.1
	netbsd-1-3-RELEASE:1.1
	netbsd-1-3-BETA:1.1
	netbsd-1-3:1.1.0.2
	netbsd-1-3-base:1.1;
locks; strict;
comment	@;; @;


1.2
date	2001.09.10.18.27.42;	author christos;	state dead;
branches;
next	1.1;

1.1
date	97.03.01.19.42.56;	author christos;	state Exp;
branches;
next	;


desc
@@


1.2
log
@- Remove old files.
- Port to NetBSD
XXX: *untested*
@
text
@;;; $NetBSD: bootcode.asm,v 1.1 1997/03/01 19:42:56 christos Exp $
;;; Hello emacs, this looks like -*- asm -*- code, doesn't it?
;;;
;;; This forms a simple dummy boot program for use with a tool to
;;; format DOS floppies.  All it does is displaying a message, and
;;; recover gracefully by re-initializing the CPU.
;;;
;;; Written by Joerg Wunsch, Dresden.  Placed in the public domain.
;;; This software is provided as is, neither kind of warranty applies.
;;; Use at your own risk.
;;;
;;; (This is written in as86 syntax.  as86 is part of Bruce Evans'
;;; bcc package.)
;;;
;;; Id: bootcode.asm,v 1.3 1997/02/22 16:06:36 peter Exp 
;;; 
;;; This code must be linked to address 0x7c00 in order to function
;;; correctly (the BIOS boot address).
;;; 
;;; It's 16-bit code, and we don't care for a data segment.
	use16
	.text

	entry	_begin
_begin:	jmp	init		; jump to boot prog
	nop			; historical baggage ;-)
;;; 
;;; Reserve space for the "BIOS parameter block".
;;; This will be overwritten by the actual formatting routine.
;;; 
bpb:	.ascii	"BSD  4.4"	; "OEM" name
	.word	512		; sector size
	.byte	2		; cluster size
	.word	1		; reserved sectors (just the boot sector)
	.byte	2		; FAT count
	.word	112		; # of entries in root dir
	.word	1440		; total number of sectors, MSDOS 3.3 or below
	.byte	0xf9		; "media descriptor"
	.word	3		; FAT size (sectors)
	.word	9		; sectors per track
	.word	2		; heads per cylinder
	.word	0		; hidden sectors
	;; MSDOS 4.0++ -- only valid iff total number of sectors == 0
	.word	0		; unused
	.long	0		; total number of sectors
	.short	0		; physical drive (0, 1, ..., 0x80) %-)
	.byte	0		; "extented boot signature"
	.long	0		; volume serial number (i.e., garbage :)
	.ascii	"           "	; label -- same as vol label in root dir
	.ascii	"FAT12   "	; file system ID
;;;
;;; Executable code starts here.
;;; 
init:
	;; First, display our message.
	mov	si, *message
lp1:	seg	cs
	movb	al, [si]
	inc	si
	testb	al, al
	jz	lp2		; null-terminated string
	movb	bl, *7		; display with regular attribute
	movb	ah, *0x0e	; int 0x10, fnc 0x0e -- emulate tty
	int	0x10
	jmp	lp1
lp2:	xorb	ah, ah		; int 0x16, fnc 0x00 -- wait for keystroke
	int	0x16
	mov	ax, *0x40	; write 0x1234 to address 0x472 --
	push	ax		; tell the BIOS that this is a warm boot
	pop	dx
	mov	0x72, *0x1234
	jmpf	0xfff0,0xf000	; jump to CPU initialization code

message:
	.byte	7
	.byte	0xc9
	.byte	0xcd,0xcd,0xcd,0xcd,0xcd,0xcd,0xcd,0xcd,0xcd,0xcd
	.byte	0xcd,0xcd,0xcd,0xcd,0xcd,0xcd,0xcd,0xcd,0xcd,0xcd
	.byte	0xcd,0xcd,0xcd,0xcd,0xcd,0xcd,0xcd,0xcd,0xcd,0xcd
	.byte	0xcd,0xcd,0xcd,0xcd,0xcd,0xcd,0xcd,0xcd,0xcd,0xcd
	.byte	0xcd,0xcd,0xcd,0xcd,0xcd,0xcd
	.byte	0xbb, 13, 10, 0xba
	.ascii	"  Sorry, this disc does actually not contain  "
	.byte	0xba, 13, 10, 0xba
	.ascii	"  a bootable system.                          "
	.byte	0xba, 13, 10, 0xba
	.ascii	"  Press any key to reboot.                    "
	.byte	0xba, 13, 10, 0xc8
	.byte	0xcd,0xcd,0xcd,0xcd,0xcd,0xcd,0xcd,0xcd,0xcd,0xcd
	.byte	0xcd,0xcd,0xcd,0xcd,0xcd,0xcd,0xcd,0xcd,0xcd,0xcd
	.byte	0xcd,0xcd,0xcd,0xcd,0xcd,0xcd,0xcd,0xcd,0xcd,0xcd
	.byte	0xcd,0xcd,0xcd,0xcd,0xcd,0xcd,0xcd,0xcd,0xcd,0xcd
	.byte	0xcd,0xcd,0xcd,0xcd,0xcd,0xcd
	.byte	0xbc, 13,10
	.byte	0

	;; Adjust the value below after changing the length of
	;; the code above!
	.space	0x1fe-0x161	; pad to 512 bytes

	.byte	0x55, 0xaa	; yes, we are bootable (cheating :)
	end
	
@


1.1
log
@From FreeBSD's mkdosfs:
	- KNF
	- cleaned up a few typos.
	- use the msdosfs header files.
	- separated Makefile and Makefile.boot, since we cannot build
	  bootcode.h (yet)
ToDo:
	- Make it work on hard disks; only works on floppies
	- Make it accept an msdos.sys io.sys and a command.com, to make
	  a real dos bootable disk.
@
text
@d1 1
a1 1
;;; $NetBSD$
@

