flat assembler
Message board for the users of flat assembler.

Index > OS Construction > Booting Characters > 7-bits

Author
Thread Post new topic Reply to topic
smiddy



Joined: 31 Oct 2004
Posts: 557
smiddy 17 Dec 2014, 18:35
I have been trying to find a reference to boot process in particular the character sets used, and if I can influence it to be more than the 256 characters defined in ASCII character set. It appears there is a 512 character set, that can be programmed, but it got me to wondering, can you go to any of the UTF-XX character sets?

Has anyone here delved into this at all? What problems pitfalls, or goodness-es have you encountered?

I'd like to use a text mode, with characters I develop and use those in text mode, but I think there is a small problem in that the character is a byte, and the attribute is a byte, which doesn't leave room for multi-byte character sets, so how is that done, if at all?

As always, constructive thoughts are welcome.

Smiddy
Post 17 Dec 2014, 18:35
View user's profile Send private message Reply with quote
BAiC



Joined: 22 Mar 2011
Posts: 272
Location: California
BAiC 18 Dec 2014, 00:35
there are only 3 scan code sets that I know of (raw data from keyboard). if you make a program like Windows' Character Map then you can generate a character set that's as large as you want (keyboard combos from the scan codes could be used as well).

it's mostly a software issue. that said; most people use a form of the UTF encoding scheme (which includes ASCII as a subset).

if you want arbitrary glyphs then you'll need one of the bitmap video modes. VGA Text Mode only supports 256 characters that I know of. if you change the VGA Text Font dynamically it'll change everything on screen rather than an individual character.

- Stefan

_________________
byte me.
Post 18 Dec 2014, 00:35
View user's profile Send private message Visit poster's website Reply with quote
neville



Joined: 13 Jul 2008
Posts: 507
Location: New Zealand
neville 18 Dec 2014, 03:36
smiddy, it might be worth reading up about code pages.

Later versions of M$-DOS could change character sets by loading code pages (usually .CPI files iirc). This is how non-English character sets were set up. The standard English/American character set was code page 437.

Although only 256 characters (and 256 attributes) could be defined at one time, it was possible to produce "pseudo-graphical" user interfaces in text mode using graphics characters.

_________________
FAMOS - the first memory operating system
Post 18 Dec 2014, 03:36
View user's profile Send private message Visit poster's website Reply with quote
baldr



Joined: 19 Mar 2008
Posts: 1651
baldr 18 Dec 2014, 03:58
smiddy,

VGA uses bit 3 of attribute byte to select one of character definition tables designated by two fields in Sequencer Character Map Select register (3C4/5[3]), along with foreground color. Thus you can display 512 different shapes simultaneously in text mode (probably halving foreground color palette).
Post 18 Dec 2014, 03:58
View user's profile Send private message Reply with quote
smiddy



Joined: 31 Oct 2004
Posts: 557
smiddy 18 Dec 2014, 04:12
baldr wrote:
smiddy,

VGA uses bit 3 of attribute byte to select one of character definition tables designated by two fields in Sequencer Character Map Select register (3C4/5[3]), along with foreground color. Thus you can display 512 different shapes simultaneously in text mode (probably halving foreground color palette).
Yeah, I found this and it is enticing, which I will likely use. The use of the third bit remove the high intensity bit functionality the way I understand it.

From your put, I would like to try to do something like Norton used to do for DOS, way back in the day, use the regular set, and then use the secondary set for the glyphs, if that is what they did, I'm not convinced their mouse driver wasn't actually a VGA graphics mode using a combination of drawing and text and glyphs.

neville, I believe OS/2 had a similar scheme too, I'll give that a read.
Post 18 Dec 2014, 04:12
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20433
Location: In your JS exploiting you and your system
revolution 18 Dec 2014, 06:45
smiddy wrote:
I would like to try to do something like Norton used to do for DOS, way back in the day, use the regular set, and then use the secondary set for the glyphs, if that is what they did ...
IIRC it was simpler than that: they just used four characters out of the base 256 set and rewrote those four on the fly to show the cursor.
Post 18 Dec 2014, 06:45
View user's profile Send private message Visit poster's website Reply with quote
smiddy



Joined: 31 Oct 2004
Posts: 557
smiddy 18 Dec 2014, 12:12
revolution wrote:
smiddy wrote:
I would like to try to do something like Norton used to do for DOS, way back in the day, use the regular set, and then use the secondary set for the glyphs, if that is what they did ...
IIRC it was simpler than that: they just used four characters out of the base 256 set and rewrote those four on the fly to show the cursor.
Everything I keep finding says that, and that makes sense too, a character to screen translation. If I can use another 256 characters I can do even more, making a set of characters that boundaries and buttons for the interface.
Post 18 Dec 2014, 12:12
View user's profile Send private message Reply with quote
baldr



Joined: 19 Mar 2008
Posts: 1651
baldr 18 Dec 2014, 18:22
smiddy,

There is small quirk in 9-dot A/N modes: ninth column of character cell is either blank or copy of eighth (for codepoints 0xC0…0xDF which usually contain line drawing glyphs). This behavior is controlled by Enable Line Graphics bit in Attribute Mode Control register of Attribute Controller (0x3C0/1[16], bit 2).
Post 18 Dec 2014, 18:22
View user's profile Send private message Reply with quote
smiddy



Joined: 31 Oct 2004
Posts: 557
smiddy 18 Dec 2014, 18:31
Thanks for the heads up!
Post 18 Dec 2014, 18:31
View user's profile Send private message Reply with quote
smiddy



Joined: 31 Oct 2004
Posts: 557
smiddy 18 Dec 2014, 18:35
Post 18 Dec 2014, 18:35
View user's profile Send private message Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 8357
Location: Kraków, Poland
Tomasz Grysztar 18 Dec 2014, 18:45
I did play with the character glyph definitions a lot when I learned assembly language back in the DOS days. Too bad my early programs did survive only in a binary form. My font editor used the VGA's feature of using two fonts at once so that you could see the entire font you edited and at the same time still have an UI using regular font.
Post 18 Dec 2014, 18:45
View user's profile Send private message Visit poster's website Reply with quote
smiddy



Joined: 31 Oct 2004
Posts: 557
smiddy 18 Dec 2014, 19:32
Kewl, thanks! I will model it after this, nice. Too bad you don't have the sources though...Smile

EDIT: I really like the scribble font!
Post 18 Dec 2014, 19:32
View user's profile Send private message Reply with quote
smiddy



Joined: 31 Oct 2004
Posts: 557
smiddy 19 Dec 2014, 23:35
Tomasz

Do you happen to recall the *.f16 format?

8 x 16 bits per character = 128 bits/character = 16 bytes/character

16 bytes/character x 256 characters = 4096 bytes

That appears right, but want to be certain. Offset 0 in *.f16 is the offset of the indexed character at 0, correct, and the rest follow suit?

I am going to try to use a secondary font shortly after I edit a font to use for a TUI using your tool (which I will model later).

Smiddy
Post 19 Dec 2014, 23:35
View user's profile Send private message Reply with quote
smiddy



Joined: 31 Oct 2004
Posts: 557
smiddy 20 Dec 2014, 03:23
Yep, 8 x 16, got it working fairly quickly in DOS, using ports (mainly). Kewl! I used Tomasz's scribble.f16 as the second font.

I need to figure out how to turn off the intensity for the second font, but this is a decent start. Ignore the carriage return and line feed, I will filter those out of my routine later.


Description:
Filesize: 38.86 KB
Viewed: 14138 Time(s)

Font-B.png


Post 20 Dec 2014, 03:23
View user's profile Send private message Reply with quote
baldr



Joined: 19 Mar 2008
Posts: 1651
baldr 20 Dec 2014, 17:21
smiddy wrote:
I need to figure out how to turn off the intensity for the second font
There are several ways to achieve that effect. You may copy lower half of palette into higher, or mask out that bit using Color Plane Enable register of Attribute Controller (0x3C0[18], bit 3).
Post 20 Dec 2014, 17:21
View user's profile Send private message Reply with quote
smiddy



Joined: 31 Oct 2004
Posts: 557
smiddy 20 Dec 2014, 18:02
baldr wrote:
smiddy wrote:
I need to figure out how to turn off the intensity for the second font
There are several ways to achieve that effect. You may copy lower half of palette into higher, or mask out that bit using Color Plane Enable register of Attribute Controller (0x3C0[18], bit 3).


Thanks! I haven't studied all the registers yet, however I was looking for intensity to no avail. Color Plane seems an area I didn't consider. Again, thanks!

Smiddy
Post 20 Dec 2014, 18:02
View user's profile Send private message Reply with quote
bubach



Joined: 17 Sep 2004
Posts: 341
Location: Trollhättan, Sweden
bubach 15 Jan 2015, 17:53
You should try the fontman DOS program (try running in dosbox) it allows loading and editing of DOS font files and will also show all the characters in the default font.

http://sta.c64.org/dosprg/fpman220.zip



This is how I modified the standard font for the first DexOS version to include a logo instead of all those UI -like lines. Wink

If you want to support proper UTF-8 in text mode I would probably suggest you do VGA mode 12h (640x480px with 12 colors) or possibly even VESA instead and emulate text mode, giving you full pixel freedom to make any font you like.

But as previously stated, you could with some trickery get 512 chars at the same time, which would be enough for most situations, if you modify the fonts on the fly depending on what is showed on screen - you could potentially have a much larger set of characters to choose from then 512 in the "virtual font".


Description:
Filesize: 114.26 KB
Viewed: 14103 Time(s)

Skärmavbild 2015-01-15 kl. 18.47.24.png



_________________
BOS homepage: http://bos.asmhackers.net/
Post 15 Jan 2015, 17:53
View user's profile Send private message Reply with quote
smiddy



Joined: 31 Oct 2004
Posts: 557
smiddy 15 Jan 2015, 18:46
Kewl, I'll take a look when I get home. Tom posted his too, which works nicely as well.

I will eventually use VGA and/or VESA and/or card specific so I can use the entire screen on flat panel. I don't know that standard VGA and VESA can/will do a 16:9 screen ratio with text. I need to do further research on that.

Then again, I am working memory implementations at the moment, then floppy/hard disk controllers. Smile

Then at some point my TUI. LOL!

Smiddy
Post 15 Jan 2015, 18:46
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
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
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.