Add externs to avoid multiple definitions, and then add missing definitions.
[rrq/maintain_lilo.git] / src / pseudo.S
1 ;  pseudo.S  -  Produce a pseudo kernel header
2 ;
3 ;               Useful for booting arbitrary
4 ;               binary images at 0x1000:0000
5 ;
6 ;  Copyright 2002-2005 John Coffman
7 ;  Copyright 2009-2011 Joachim Wiedorn
8 ;  All rights reserved.
9 ;
10 ;  Licensed under the terms contained in the file 'COPYING'
11 ;  in the source directory.
12 ;
13
14 #define DEBUG 0
15 #define DELL_DIRTY_HACK
16
17
18 SYSSEG  =  0x1000       ; DEF_SYSSEG
19 SETUPSEG = 0x9020       ; DEF_SETUPSEG
20
21 CL_MAGIC_ADDR   = 0x20                  ! command line magic number
22 CL_MAGIC        = 0xa33f                ! very unusual command sequence
23 CL_OFFSET       = 0x22                  ! command line offset
24 CL_LENGTH       = 256                   ! maximum length
25
26                 .text
27 #if 0
28 .globl  _main
29 _main:
30 #endif
31                 .globl  zero
32 zero:
33
34 ; we want this to look like a bootable kernel image
35 ; so we include the following header
36 ;
37                 jmp     begin
38                 .ascii  "HdrS"          ; looks like a real kernel
39                 .word   0x0200          ; header format version number
40                 .word   0,0             ; realmode switch, SETUPSEG
41                 .word   SYSSEG          ; SYSSEG -- load at 1000:0000
42                 .word   id_string
43                 .byte   0               ; type of loader
44                 .byte   0               ; flags 0=load low
45                 .word   2*512           ; move size: 2 sectors
46                 dd      0x10000         ; load us here
47                 dd      0               ; ramdisk image
48                 dd      0               ; ramdisk size
49                 .word   bs_helper,SETUPSEG      ; kludge???
50 ;;              .word   modelist+1024   ; heap end pointer
51 ;----------end of header------------
52                 
53 begin:
54         xor     di,di
55         cmp     word ptr [CL_MAGIC_ADDR],#CL_MAGIC
56         jne     gotoit
57         mov     di,[CL_OFFSET]
58 gotoit:
59         jmpi    0000,SYSSEG                     ; jmp to 0x1000:0000
60
61
62 bs_helper:      int     0x19                    ;label here for kludge
63
64
65 id_string:      .ascii  "pseudo.b"
66                 .byte   0
67
68                 .blkb   zero+512-*
69
70 modelist:
71
72 theend: