Software Engineering Talk
Software Engineering Talk
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Old BIOS functions still supported?; and PC initial video mo
Goto page 1, 2  Next
 
Post new topic   Reply to topic    Software Engineering Talk Forum Index -> Software Engineering Talk
View previous topic :: View next topic  
Author Message
James Harris
Guest





PostPosted: Sat Jul 05, 2008 10:45 pm    Post subject: Old BIOS functions still supported?; and PC initial video mo Reply with quote

Is there a standard video mode PCs use when booting? I've tried a few
machines and they all seem to start in mode 3.

Also, have been trying to use int 0x10, functions 2 (set the cursor
position) and 8 (read character at the cursor position) but both seem
to be unsupported on at least one machine and one emulator.

Perhaps some old BIOS functions are no longer supported on newer
machines? I am checking the carry flag to determine failure or
success. According to RBIL (v61 - the latest) these functions do not
have a failure option but they do seem to return the carry flag set.

--
Back to top
  Ads
Advertising
Sponsor


Brendan
Guest





PostPosted: Sun Jul 06, 2008 8:00 am    Post subject: Re: Old BIOS functions still supported?; and PC initial vide Reply with quote

Hi,

On Jul 6, 7:45 am, James Harris <james.harri...@googlemail.com> wrote:
Quote:
Is there a standard video mode PCs use when booting? I've tried a few
machines and they all seem to start in mode 3.

I have come across at least one machine that doesn't start in 40 * 25
text mode. It wasn't my computer (it belonged to a friend's work) so I
couldn't investigate much, but it booted with a graphical splash-
screen and I think it stayed in 640*480 16 colour graphics mode after
boot.

Quote:
Also, have been trying to use int 0x10, functions 2 (set the cursor
position) and 8 (read character at the cursor position) but both seem
to be unsupported on at least one machine and one emulator.

Perhaps some old BIOS functions are no longer supported on newer
machines? I am checking the carry flag to determine failure or
success. According to RBIL (v61 - the latest) these functions do not
have a failure option but they do seem to return the carry flag set.

Perhaps these functions don't set or clear the carry flag at all, and
you think they failed when they didn't?

AFAIK except for video modes set by VESA/VBE (where support for text
output functions is optional) and "non-VGA compatible" hardware (where
support for anything related to VGA is optional), these functions
should work...


Cheers,

Brendan
Back to top
  Ads
Advertising
Sponsor


Maxim S. Shatskih
Guest





PostPosted: Sun Jul 06, 2008 5:21 pm    Post subject: Re: Old BIOS functions still supported?; and PC initial vide Reply with quote

Quote:
Perhaps some old BIOS functions are no longer supported on newer
machines? I am checking the carry flag to determine failure or
success. According to RBIL (v61 - the latest) these functions do not
have a failure option but they do seem to return the carry flag set.

So what? They cannot fail, so, the carry flag status after the call is not
relevant for them.

--
Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
maxim@storagecraft.com
http://www.storagecraft.com
Back to top
  Ads
Advertising
Sponsor


Wolfgang Kern
Guest





PostPosted: Sun Jul 06, 2008 6:03 pm    Post subject: Re: Old BIOS functions still supported?; and PC initial vide Reply with quote

James Harris wrote:

Quote:
Is there a standard video mode PCs use when booting? I've tried a few
machines and they all seem to start in mode 3.

Even (IBM)'compatible' main BIOS seem not to rely on mode 3
to work if a non onboard VBIOS is present and activated, so
all my BIOSes first try to set mode 3 and default to EGA/CGA
modes or error-beep-halt if also this failed.

Exoctic PCs like Amstrad, Packard Bell, Compaq and similar BIOS
may cook their own ill soup here.

Latest mainbords often contain a onboard GPU, so here the BIOS
may know about it and start with another mode ie: 640*480;16
(looks like standard for EGA/VGA).

Quote:
Also, have been trying to use int 0x10, functions 2 (set the cursor
position) and 8 (read character at the cursor position) but both seem
to be unsupported on at least one machine and one emulator.

Function 0x1002 /08 may need BX=0 to work at all on some cards
and both will not work in graphic modes anyway.

You could 'manually' set the text-cursor-position (like I use):

Mode3_pos_cursor:
;PUSH ds ;push/pop aren't needed for 'Flat-memory'
;PUSH 0
;POP ds
MOV word [0x0450],ax ;IIRC: AH=row AL=column, ..or opposite ;)
;POP ds

A readback from texmode-3 screen seems also easy:
;start + line*size + char-pos in line
;0x0b8000 + row*2*80 + column*2

use16:
MOV bx,ax ;AL=column AH=row
MOVZX ax,bh
IMUL ax,0x00a0 ;*160
MOV bh,0
ADD bx,bx ;*2
ADD bx,ax
PUSH es
PUSH 0xb800
POP es
MOV ax,es:[bx] ;AL=char AH=attribute
POP es

or(use32 flat):
MOVZX ebx,al
MOVZX eax,ah
IMUL eax,0x000000a0 ;*160
;LEA eax,[eax+eax*4] ;*5 (may be faster on some CPUs)
;SHL eax,5 ;*32
MOV ax,[eax+ebx*2+0x0b8000] ;done

Quote:
Perhaps some old BIOS functions are no longer supported on newer
machines?

'newer' graphic-cards will have a VGA-capability-flag in the PCI
configuration and/or in the VESA-info block.

Quote:
I am checking the carry flag to determine failure or
success. According to RBIL (v61 - the latest) these functions do not
have a failure option but they do seem to return the carry flag set.

I'd check 'carry as fail' on VGA mode-set only.

Most not too old graphic adapters support at least VESA 2.0, and
here all functions return the success status in AX (0x004F or else),
even VESA-cards tend to miss text-mode support.

__
wolfgang
Back to top
  Ads
Advertising
Sponsor


James Harris
Guest





PostPosted: Mon Jul 07, 2008 8:37 am    Post subject: Re: Old BIOS functions still supported?; and PC initial vide Reply with quote

On 6 Jul, 09:00, Brendan <btrot...@gmail.com> wrote:
Quote:
Hi,

On Jul 6, 7:45 am, James Harris <james.harri...@googlemail.com> wrote:

Is there a standard video mode PCs use when booting? I've tried a few
machines and they all seem to start in mode 3.

I have come across at least one machine that doesn't start in 40 * 25
text mode. It wasn't my computer (it belonged to a friend's work) so I
couldn't investigate much, but it booted with a graphical splash-
screen and I think it stayed in 640*480 16 colour graphics mode after
boot.

Thanks for the help. I think this is an 80 * 25 mode but it's not a
problem for me either way. I pick up the screen width from int 0x10
ah=3.

Quote:
Also, have been trying to use int 0x10, functions 2 (set the cursor
position) and 8 (read character at the cursor position) but both seem
to be unsupported on at least one machine and one emulator.

Perhaps some old BIOS functions are no longer supported on newer
machines? I am checking the carry flag to determine failure or
success. According to RBIL (v61 - the latest) these functions do not
have a failure option but they do seem to return the carry flag set.

Perhaps these functions don't set or clear the carry flag at all, and
you think they failed when they didn't?

After some more testing that seems to be exactly what's happening.
Certainly, if I ignore the carry flag on return these functions can be
seen to work on at least two machines.

I guess the conclusion is that not all BIOS functions set carry to
indicate error and that if RBIL doesn't document a failure return then
there may not be one.

In fact for the ah = 2 function (set the cursor position) RBIL
explicitly documents "Return: nothing" so I now believe that includes
the carry flag.

Quote:
AFAIK except for video modes set by VESA/VBE (where support for text
output functions is optional) and "non-VGA compatible" hardware (where
support for anything related to VGA is optional), these functions
should work...

OK. I think what I'll do is ignore the return from these two calls.
It's not a show stopper if they return invalid data on some machines.
I am only coding this to gather as much as I can from the pre-boot
screen for the console log. Nice to have in some circumstances but not
essential.
Back to top
  Ads
Advertising
Sponsor


James Harris
Guest





PostPosted: Mon Jul 07, 2008 8:46 am    Post subject: Re: Old BIOS functions still supported?; and PC initial vide Reply with quote

On 6 Jul, 13:21, "Maxim S. Shatskih" <ma...@storagecraft.com> wrote:
Quote:
Perhaps some old BIOS functions are no longer supported on newer
machines? I am checking the carry flag to determine failure or
success. According to RBIL (v61 - the latest) these functions do not
have a failure option but they do seem to return the carry flag set.

So what? They cannot fail, so, the carry flag status after the call is not
relevant for them.

Ah=2 set cursor position could receive an invalid cursor position
(i.e. off the limits of the page). From what you and others have said
I guess it doesn't check but just overwrites the BDA entry with
whatever row and column it was given. Ah=8, though, could find the
cursor pointing at an invalid cell. Perhaps it doesn't check and just
tries to make sense of what it finds at the resulting memory
location ... if it fails to recognise a character perhaps it reurns
zero...?

Either way is OK. If I receive a non-printable character code I just
change it to something printable, currently a tilde, (~).
Back to top
  Ads
Advertising
Sponsor


James Harris
Guest





PostPosted: Mon Jul 07, 2008 8:54 am    Post subject: Re: Old BIOS functions still supported?; and PC initial vide Reply with quote

On 6 Jul, 14:03, "Wolfgang Kern" <nowh...@never.at> wrote:
Quote:
James Harris wrote:
Is there a standard video mode PCs use when booting? I've tried a few
machines and they all seem to start in mode 3.

Even (IBM)'compatible' main BIOS seem not to rely on mode 3
to work if a non onboard VBIOS is present and activated, so
all my BIOSes first try to set mode 3 and default to EGA/CGA
modes or error-beep-halt if also this failed.

Exoctic PCs like Amstrad, Packard Bell, Compaq and similar BIOS
may cook their own ill soup here.

Latest mainbords often contain a onboard GPU, so here the BIOS
may know about it and start with another mode ie: 640*480;16
(looks like standard for EGA/VGA).

Interesting. I hope the function will still work for these as ah=8 is
supposed to work in graphics mode (presumably by matching the bit
pattern with the character font tables). If it doesn't on some
machines it's no great loss.

Quote:
Also, have been trying to use int 0x10, functions 2 (set the cursor
position) and 8 (read character at the cursor position) but both seem
to be unsupported on at least one machine and one emulator.

Function 0x1002 /08 may need BX=0 to work at all on some cards
and both will not work in graphic modes anyway.

I think they are _supposed_ to work in graphics modes. For the BX
value I set bh to the current page (taken from int 0x10 ah=0xf). I
don't set bl at this time.

<code snipped>

Quote:
I'd check 'carry as fail' on VGA mode-set only.

Most not too old graphic adapters support at least VESA 2.0, and
here all functions return the success status in AX (0x004F or else),
even VESA-cards tend to miss text-mode support.

OK. Thanks for the code samples and other info.
Back to top
  Ads
Advertising
Sponsor


Rod Pemberton
Guest





PostPosted: Mon Jul 07, 2008 4:08 pm    Post subject: Re: Old BIOS functions still supported?; and PC initial vide Reply with quote

"James Harris" <james.harris.1@googlemail.com> wrote in message
news:9e7ceec6-1986-4caa-8221-cfcb7d01eaeb@x35g2000hsb.googlegroups.com...
Quote:
OK. I think what I'll do is ignore the return from these two calls.
It's not a show stopper if they return invalid data on some machines.
I am only coding this to gather as much as I can from the pre-boot
screen for the console log. Nice to have in some circumstances but not
essential.

Are you setting the carry prior to call? I.e., is it possible they only
clear the carry?


Rod Pemberton
Back to top
  Ads
Advertising
Sponsor


Wolfgang Kern
Guest





PostPosted: Mon Jul 07, 2008 5:03 pm    Post subject: Re: Old BIOS functions still supported?; and PC initial vide Reply with quote

James Harris wrote:

....
Quote:
Function 0x1002 /08 may need BX=0 to work at all on some cards
and both will not work in graphic modes anyway.

I think they are _supposed_ to work in graphics modes. For the BX
value I set bh to the current page (taken from int 0x10 ah=0xf). I
don't set bl at this time.

It will depend on the selected mode, a few may support TTY functions,
my preferred (1024*768,8/32 1152*864,8/32 and above) seem not to.
So if I use character oriented INT10 functions while in graphic mode,
I just see a few line patterns on the screen or nothing in most case.

Read back color-bit patterns and compare it to font patterns to
determine a character-number may not work at all, and if it worked
(perhaps in a monocrome mode) it would need 'certain' time.

I can't remember where I read about the BX=0 workaround for some VBIOS.

__
wolfgang
Back to top
  Ads
Advertising
Sponsor


Maxim S. Shatskih
Guest





PostPosted: Mon Jul 07, 2008 9:44 pm    Post subject: Re: Old BIOS functions still supported?; and PC initial vide Reply with quote

Quote:
It will depend on the selected mode, a few may support TTY functions,

In old days of EGA/VGA int 10h could print in graphics mode.

--
Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
maxim@storagecraft.com
http://www.storagecraft.com
Back to top
  Ads
Advertising
Sponsor


James Harris
Guest





PostPosted: Tue Jul 08, 2008 11:11 pm    Post subject: Re: Old BIOS functions still supported?; and PC initial vide Reply with quote

On 7 Jul, 12:08, "Rod Pemberton" <do_not_h...@nohavenot.cmm> wrote:
....
Quote:
Are you setting the carry prior to call? I.e., is it possible they only
clear the carry?

You mean like a sticky error bit? I'd be surprised as I'm not aware of
anything else in the BIOS that works that way. Interesting idea if the
error flag wasn't as volatile as a flag bit, though.

In my code I was neither setting nor clearing carry prior to invoking
them. It's possible that the carry flag is carried through or more
likely simply undefined after those two calls. I presume that this was
not originally explicitly documented, the only requirement was for
BIOSes to mimic IBM's code sufficiently, and that clone BIOSes are
known to vary a little (due to bugs or assumptions) so we need to code
to accept variation. Since I've removed the carry flag checks the
routines seem to work OK.
Back to top
  Ads
Advertising
Sponsor


Rod Pemberton
Guest





PostPosted: Wed Jul 09, 2008 6:52 am    Post subject: Re: Old BIOS functions still supported?; and PC initial vide Reply with quote

"James Harris" <james.harris.1@googlemail.com> wrote in message
news:fde15be3-30a8-4f07-87e9-1066cb76f81e@t54g2000hsg.googlegroups.com...
Quote:
On 7 Jul, 12:08, "Rod Pemberton" <do_not_h...@nohavenot.cmm> wrote:
...
Are you setting the carry prior to call? I.e., is it possible they only
clear the carry?

You mean like a sticky error bit?

It's not important. I was just curious as to whether you'd found something
undocumented. AFAICT, there's nothing indicate you should look at the carry
after an Int 0x10 call, but you did... ;-) So, I thought you were curious
too! (The version of RBIL I'm using does say it's v61...)

Quote:
I'd be surprised as I'm not aware of
anything else in the BIOS that works that way.

Int 0x13, AH=02h? Int 0x15, AH=88h? (both from RBIL)


Rod Pemberton
Back to top
  Ads
Advertising
Sponsor


James Harris
Guest





PostPosted: Wed Jul 09, 2008 7:47 pm    Post subject: Re: Old BIOS functions still supported?; and PC initial vide Reply with quote

On 9 Jul, 02:52, "Rod Pemberton" <do_not_h...@nohavenot.cmm> wrote:
Quote:
"James Harris" <james.harri...@googlemail.com> wrote in message

news:fde15be3-30a8-4f07-87e9-1066cb76f81e@t54g2000hsg.googlegroups.com...

On 7 Jul, 12:08, "Rod Pemberton" <do_not_h...@nohavenot.cmm> wrote:
...
Are you setting the carry prior to call? I.e., is it possible they only
clear the carry?

You mean like a sticky error bit?

It's not important. I was just curious as to whether you'd found something
undocumented. AFAICT, there's nothing indicate you should look at the carry
after an Int 0x10 call, but you did... ;-)

I wasn't sure whether RBIL was complete but it seems it is for these
calls. I hadn't appreciated at all that int 0x10 calls don't seem to
return any error code.

Quote:
So, I thought you were curious
too! (The version of RBIL I'm using does say it's v61...)

I'd be surprised as I'm not aware of
anything else in the BIOS that works that way.

Int 0x13, AH=02h? Int 0x15, AH=88h? (both from RBIL)

In the version of RBIL I have, v61 converted to a winhelp file, both
of these are documented as returning carry explicitly clear or set ...
but it's a minor issue.

A possibly more interesting discussion is that v61, the most up to
date RBIL, is dated July 2000 which means it is 8 years since its last
release. Are there updates that should have been made since then?
Perhaps Ralf Brown has moved on to other things. Either way would it
be a good idea for the RBIL data to be community maintained in some
way? Anyone know if Ralf would be happy to relinquish control? Perhaps
some info is already available on Helppc but it too is closed to
updates, as far as I can see.

--
James
Back to top
  Ads
Advertising
Sponsor


Rod Pemberton
Guest





PostPosted: Thu Jul 10, 2008 5:53 am    Post subject: Re: Old BIOS functions still supported?; and PC initial vide Reply with quote

"James Harris" <james.harris.1@googlemail.com> wrote in message
news:5ebe1413-a855-4c64-866b-14a908ba3f6f@79g2000hsk.googlegroups.com...
Quote:
On 9 Jul, 02:52, "Rod Pemberton" <do_not_h...@nohavenot.cmm> wrote:
Int 0x13, AH=02h? Int 0x15, AH=88h? (both from RBIL)

In the version of RBIL I have, v61 converted to a winhelp file, both
of these are documented as returning carry explicitly clear or set ...
but it's a minor issue.


Well, yeah, that's how they're supposed to work...

RBIL v61 (in ASCII text):

Int 0x13, AH=02h
"BUGS:"
....
" Apparently some BIOSes or intercepting resident software have bugs
that may destroy DX on return or not properly set the Carry flag.
At least some Microsoft software frames calls to this function with
PUSH DX, STC, INT 13h, STI, POP DX."

Int 0x15, AH=88h
"Notes:"
....
" not all BIOSes correctly return the carry flag, making this call
unreliable unless one first checks whether it is supported through
a mechanism other than calling the function and testing CF"

Reading the fine print...,


Rod Pemberton
Back to top
  Ads
Advertising
Sponsor


James Harris
Guest





PostPosted: Thu Jul 10, 2008 1:27 pm    Post subject: Re: Old BIOS functions still supported?; and PC initial vide Reply with quote

On 10 Jul, 01:53, "Rod Pemberton" <do_not_h...@nohavenot.cmm> wrote:
....
Quote:

Reading the fine print...,

Ah, OK.
Back to top
  Ads
Advertising
Sponsor


Display posts from previous:   
Post new topic   Reply to topic    Software Engineering Talk Forum Index -> Software Engineering Talk All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

Australian Debt Consolidation Experts
medical insurance
Wedding Ring
Annunci di escort e accompagnatrici a Rimini, Padova, Treviso, in Riviera Adriatica, in Versilia ...
Free Porn
Business Associations
mortgage quotations
Make Your Own Website
Free phone calls to Canada
Long island Cleaning service
mold killer
UK Swingers Genuine Contacts Site
floor machines
Eureka Vacuum Parts


Board Security

125 Attacks blocked

Powered by phpBB © 2001, 2005 phpBB Group