source: trunk/minix/boot/a.out2com@ 9

Last change on this file since 9 was 9, checked in by Mattia Monga, 14 years ago

Minix 3.1.2a

File size: 693 bytes
RevLine 
[9]1#!/bin/sh
2#
3# a.out2com - Minix a.out to DOS .COM Author: Kees J. Bot
4# 17 Jun 1995
5# Transform a Minix a.out to the COM format of MS-DOS,
6# the executable must be common I&D with 256 scratch bytes at the start of
7# the text segment to make space for the Program Segment Prefix. The Minix
8# a.out header and these 256 bytes are removed to make a COM file.
9
10case $# in
112) aout="$1"
12 com="$2"
13 ;;
14*) echo "Usage: $0 <a.out> <dos.com>" >&2
15 exit 1
16esac
17
18size "$aout" >/dev/null || exit
19set `size "$aout" | sed 1d`
20count=`expr \( $1 + $2 - 256 + 31 \) / 32`
21
22exec dd if="$aout" of="$com" bs=32 skip=9 count=$count conv=silent
23
24#
25# $PchId: a.out2com,v 1.3 1998/08/01 09:13:01 philip Exp $
Note: See TracBrowser for help on using the repository browser.