aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeroen Janssen <japj@xs4all.nl>2002-04-19 17:38:29 +0000
committerJeroen Janssen <japj@xs4all.nl>2002-04-19 17:38:29 +0000
commit4277ac1709a31c2b26cb7de575425241bc583ee7 (patch)
treefab5035e7a6db10538d8854fb68d0da419202056
parent27a8999a5dda86609ea037ccaf9eb4b2eb40670b (diff)
downloadvgabios-4277ac1709a31c2b26cb7de575425241bc583ee7.tar.gz
- fixing preprocessing of vgabios with latest gcc (from Mandrake 8.2)
-rw-r--r--Makefile7
-rw-r--r--vbe.c20
-rw-r--r--vgabios.c100
3 files changed, 65 insertions, 62 deletions
diff --git a/Makefile b/Makefile
index 51d9d8f..9027bef 100644
--- a/Makefile
+++ b/Makefile
@@ -35,7 +35,9 @@ vgabios.bin: vgabios.o
ls -l vgabios.bin
vgabios.o: vgabios.c vgabios.h vgafonts.h vgatables.h vbe.h vbe.c vbetables.h
- gcc -E vgabios.c -DVBE -DVGABIOS_DATE="\"$(RELDATE)\"" | tools86 -E > _vgabios_.c
+ gcc -E vgabios.c -DVBE -DVGABIOS_DATE="\"$(RELDATE)\"" | tools86 -E > _vgabios.c
+ cat _vgabios.c | sed -e "s/##asm/#asm/g" -e "s/##endasm/#endasm/g" > _vgabios_.c
+
/usr/lib/bcc/bcc-cc1 -o vgabios.s -c -D__i86__ -0 _vgabios_.c
./dataseghack vgabios.s
# bug : with -j i get 1 byte displacement at the end of bin file !
@@ -51,7 +53,8 @@ vgabios.debug.bin: vgabios.debug.o
ls -l vgabios.debug.bin
vgabios.debug.o: vgabios.c vgabios.h vgafonts.h vgatables.h vbe.h vbe.c vbetables.h
- gcc -E vgabios.c -DVBE -DDEBUG -DVGABIOS_DATE="\"$(RELDATE)\"" | tools86 -E > _vgabios_.debug.c
+ gcc -E vgabios.c -DVBE -DDEBUG -DVGABIOS_DATE="\"$(RELDATE)\"" | tools86 -E > _vgabios.debug.c
+ cat _vgabios.debug.c | sed -e "s/##asm/#asm/g" -e "s/##endasm/#endasm/g" > _vgabios_.debug.c
/usr/lib/bcc/bcc-cc1 -o vgabios.debug.s -c -D__i86__ -0 _vgabios_.debug.c
./dataseghack vgabios.debug.s
as86 vgabios.debug.s -o vgabios.debug.o -u -w -g -0
diff --git a/vbe.c b/vbe.c
index fb23696..dd0d049 100644
--- a/vbe.c
+++ b/vbe.c
@@ -64,7 +64,7 @@ extern char vbebios_product_revision;
extern Bit16u vbebios_mode_list;
#endif
-#asm
+##asm
// FIXME: 'merge' these (c) etc strings with the vgabios.c strings?
_vbebios_copyright:
.ascii "Bochs/Plex86 VBE(C) 2002 Jeroen Janssen <japj@darius.demon.nl>"
@@ -120,12 +120,12 @@ _vbebios_mode_list:
.word VBE_VESA_MODE_END_OF_LIST
#endif
-#endasm
+##endasm
// from rombios.c
#define PANIC_PORT 0x501
-#asm
+##asm
MACRO HALT
;; the HALT macro is called with the line number of the HALT call.
;; The line number is then sent to the PANIC_PORT, causing Bochs to
@@ -136,7 +136,7 @@ MACRO HALT
mov ax,#?1
out dx,ax
MEND
-#endasm
+##endasm
// DISPI ioport functions
// FIXME: what if no VBE host side code?
@@ -233,9 +233,9 @@ void vbe_init()
if (dispi_id!=VBE_DISPI_ID0)
{
//FIXME this results in a 'rombios.c' line panic, but it's actually a 'vbe.c' panic
-#asm
+##asm
HALT(__LINE__)
-#endasm
+##endasm
}
//#ifdef DEBUG
printf("VBE Bios $Id$\n");
@@ -249,21 +249,21 @@ void vbe_display_info()
// Check for VBE display extension in Bochs
if (vbe_has_vbe_display())
{
- #asm
+ ##asm
mov ax,#0xc000
mov ds,ax
mov si,#_vbebios_info_string
call _display_string
- #endasm
+ ##endasm
}
else
{
- #asm
+ ##asm
mov ax,#0xc000
mov ds,ax
mov si,#_no_vbebios_info_string
call _display_string
- #endasm
+ ##endasm
}
}
diff --git a/vgabios.c b/vgabios.c
index 5449880..b07a131 100644
--- a/vgabios.c
+++ b/vgabios.c
@@ -140,7 +140,7 @@ static void biosfn_read_video_state_size();
static void biosfn_save_video_state();
static void biosfn_restore_video_state();
-#asm
+##asm
.text
.rom
.org 0
@@ -235,12 +235,12 @@ init_no_vbe_display:
retf
-#endasm
+##endasm
/*
* int10 handled here
*/
-#asm
+##asm
vgabios_int10_handler:
pushf
push es
@@ -257,7 +257,7 @@ vgabios_int10_handler:
pop es
popf
iret
-#endasm
+##endasm
#include "vgatables.h"
#include "vgafonts.h"
@@ -267,7 +267,7 @@ vgabios_int10_handler:
*/
static void init_vga_card()
{
-#asm
+##asm
;; switch to color mode and enable CPU access 480 lines
mov dx, #0x3C2
mov al, #0xC3
@@ -283,7 +283,7 @@ static void init_vga_card()
mov al, #0x02
outb dx,al
-#endasm
+##endasm
printf("VGABios $Id$\n");
}
@@ -328,17 +328,17 @@ static void display_splash_screen()
* Tell who we are
*/
-#asm
+##asm
crlf:
.byte 0x0a,0x0d,0x00
space:
.ascii " "
.byte 0x00
-#endasm
+##endasm
static void display_info()
{
-#asm
+##asm
mov ax,#0xc000
mov ds,ax
mov si,#vgabios_name
@@ -370,13 +370,13 @@ static void display_info()
call _display_string
mov si,#crlf
call _display_string
-#endasm
+##endasm
}
static void display_string()
{
// Get length of string
-#asm
+##asm
mov ax,ds
mov es,ax
mov di,si
@@ -399,7 +399,7 @@ static void display_string()
mov bx,#0x000b
mov bp,si
int #0x10
-#endasm
+##endasm
}
// --------------------------------------------------------------------------------------------
@@ -948,25 +948,25 @@ static void biosfn_set_video_mode(mode) Bit8u mode;
// FIXME
// Set the ints 0x1F and 0x43
-#asm
+##asm
SET_INT_VECTOR(0x1f, #0xC000, #vgafont8+128*8)
-#endasm
+##endasm
switch(cheight)
{case 8:
-#asm
+##asm
SET_INT_VECTOR(0x43, #0xC000, #vgafont8)
-#endasm
+##endasm
break;
case 14:
-#asm
+##asm
SET_INT_VECTOR(0x43, #0xC000, #vgafont14)
-#endasm
+##endasm
break;
case 16:
-#asm
+##asm
SET_INT_VECTOR(0x43, #0xC000, #vgafont16)
-#endasm
+##endasm
break;
}
}
@@ -1994,7 +1994,7 @@ static void memsetb(seg,offset,value,count)
Bit16u value;
Bit16u count;
{
-#asm
+##asm
push bp
mov bp, sp
@@ -2022,7 +2022,7 @@ memsetb_end:
pop ax
pop bp
-#endasm
+##endasm
}
// --------------------------------------------------------------------------------------------
@@ -2032,7 +2032,7 @@ static void memsetw(seg,offset,value,count)
Bit16u value;
Bit16u count;
{
-#asm
+##asm
push bp
mov bp, sp
@@ -2060,7 +2060,7 @@ memsetw_end:
pop ax
pop bp
-#endasm
+##endasm
}
// --------------------------------------------------------------------------------------------
@@ -2071,7 +2071,7 @@ static void memcpyb(dseg,doffset,sseg,soffset,count)
Bit16u soffset;
Bit16u count;
{
-#asm
+##asm
push bp
mov bp, sp
@@ -2106,7 +2106,7 @@ memcpyb_end:
pop ax
pop bp
-#endasm
+##endasm
}
// --------------------------------------------------------------------------------------------
@@ -2117,7 +2117,7 @@ static void memcpyw(dseg,doffset,sseg,soffset,count)
Bit16u soffset;
Bit16u count;
{
-#asm
+##asm
push bp
mov bp, sp
@@ -2152,7 +2152,7 @@ memcpyw_end:
pop ax
pop bp
-#endasm
+##endasm
}
/* =========================================================== */
@@ -2167,7 +2167,7 @@ read_byte(seg, offset)
Bit16u seg;
Bit16u offset;
{
-#asm
+##asm
push bp
mov bp, sp
@@ -2182,7 +2182,7 @@ read_byte(seg, offset)
pop bx
pop bp
-#endasm
+##endasm
}
// --------------------------------------------------------------------------------------------
@@ -2191,7 +2191,7 @@ read_word(seg, offset)
Bit16u seg;
Bit16u offset;
{
-#asm
+##asm
push bp
mov bp, sp
@@ -2206,7 +2206,7 @@ read_word(seg, offset)
pop bx
pop bp
-#endasm
+##endasm
}
// --------------------------------------------------------------------------------------------
@@ -2216,7 +2216,7 @@ write_byte(seg, offset, data)
Bit16u offset;
Bit8u data;
{
-#asm
+##asm
push bp
mov bp, sp
@@ -2233,7 +2233,7 @@ write_byte(seg, offset, data)
pop ax
pop bp
-#endasm
+##endasm
}
// --------------------------------------------------------------------------------------------
@@ -2243,7 +2243,7 @@ write_word(seg, offset, data)
Bit16u offset;
Bit16u data;
{
-#asm
+##asm
push bp
mov bp, sp
@@ -2260,7 +2260,7 @@ write_word(seg, offset, data)
pop ax
pop bp
-#endasm
+##endasm
}
// --------------------------------------------------------------------------------------------
@@ -2268,7 +2268,7 @@ write_word(seg, offset, data)
inb(port)
Bit16u port;
{
-#asm
+##asm
push bp
mov bp, sp
@@ -2278,14 +2278,14 @@ inb(port)
pop dx
pop bp
-#endasm
+##endasm
}
Bit16u
inw(port)
Bit16u port;
{
-#asm
+##asm
push bp
mov bp, sp
@@ -2295,7 +2295,7 @@ inw(port)
pop dx
pop bp
-#endasm
+##endasm
}
// --------------------------------------------------------------------------------------------
@@ -2304,7 +2304,7 @@ outb(port, val)
Bit16u port;
Bit8u val;
{
-#asm
+##asm
push bp
mov bp, sp
@@ -2317,7 +2317,7 @@ outb(port, val)
pop ax
pop bp
-#endasm
+##endasm
}
// --------------------------------------------------------------------------------------------
@@ -2326,7 +2326,7 @@ outw(port, val)
Bit16u port;
Bit16u val;
{
-#asm
+##asm
push bp
mov bp, sp
@@ -2339,14 +2339,14 @@ outw(port, val)
pop ax
pop bp
-#endasm
+##endasm
}
Bit16u get_SS()
{
-#asm
+##asm
mov ax, ss
-#endasm
+##endasm
}
#ifdef DEBUG
@@ -2420,15 +2420,15 @@ void printf(s)
// --------------------------------------------------------------------------------------------
-#asm
+##asm
;; DATA_SEG_DEFS_HERE
-#endasm
+##endasm
-#asm
+##asm
.ascii "vgabios ends here"
.byte 0x00
vgabios_end:
.byte 0xCB
;; BLOCK_STRINGS_BEGIN
-#endasm
+##endasm