flat assembler
Message board for the users of flat assembler.

Index > OS Construction > Help please...

Goto page 1, 2  Next
Author
Thread Post new topic Reply to topic
amiflat



Joined: 27 Jul 2004
Posts: 8
Location: Italy
amiflat 28 Jul 2004, 12:00
I want to start with FASM programming. I was a masm programmer 12 years ago but i don't remember nothing.

To start i need to know what are the code to create a boot loader, get into Pmode and inizialize the vesa 2.0 graphic mode. After this iwant to turn on just one pixel on the screen. Can anyone help me, please, and collaborate to create a very simple to understand step by step tutorial?

Thank you and best regards.
Post 28 Jul 2004, 12:00
View user's profile Send private message Reply with quote
Mac2004



Joined: 15 Dec 2003
Posts: 314
Mac2004 28 Jul 2004, 12:40
Hi!

For the start you could check out these sites:

1) The Operating System Resource Center:

http://www.nondot.org/sabre/os/articles

2) Christopher Giese's pages
http://my.execpc.com/~geezer/osd/index.htm

regards,
Mac2004
Post 28 Jul 2004, 12:40
View user's profile Send private message Reply with quote
ASHLEY4



Joined: 28 Apr 2004
Posts: 376
Location: UK
ASHLEY4 28 Jul 2004, 13:00
I am making a small tut, that shows how to set up vesa2, goto pmode and from pmode switch between vesa and text . with fasm source.
If you want i can post a working copy, latter today ????.
just let me know.

ASHLEY4.
Post 28 Jul 2004, 13:00
View user's profile Send private message Reply with quote
amiflat



Joined: 27 Jul 2004
Posts: 8
Location: Italy
amiflat 28 Jul 2004, 13:10
Thank you ashley4 and mac2004
I have ton's of asm code, but i need to start from the genesis. Some of this code must be translated to fasm. So i need your help in hope for exchange of usefull information related to os programming. I will post code soon. Meanwhile i wait your tut.

Thank you again.

Best regards...
Post 28 Jul 2004, 13:10
View user's profile Send private message Reply with quote
fasm9



Joined: 19 Jun 2003
Posts: 439
fasm9 28 Jul 2004, 21:44
Post 28 Jul 2004, 21:44
View user's profile Send private message Reply with quote
kake_zinger



Joined: 15 Jul 2004
Posts: 51
kake_zinger 30 Jul 2004, 13:34
If someone knows how to set text video modes "by hand", as opposed to using bios functions, I'd be very interested to know how. I'd like to get some more use of my 1600x1200 screen than just 80x50!

Just the basic vga text memory amount should be enough for a 160x100 screen, which could be used as 4 separate 80x50 screens, for that all-important 'nuclear command center' look.
Post 30 Jul 2004, 13:34
View user's profile Send private message Reply with quote
ASHLEY4



Joined: 28 Apr 2004
Posts: 376
Location: UK
ASHLEY4 30 Jul 2004, 14:58
kake_zinger, Y not use vesa ?, its as simple as text or vga to use, with very little seting up.
ASHLEY4.
Post 30 Jul 2004, 14:58
View user's profile Send private message Reply with quote
crc



Joined: 21 Jun 2003
Posts: 637
Location: Penndel, PA [USA]
crc 30 Jul 2004, 15:11
I experimented with VESA, but didn't find it to be reliable. What works on one machine won't work on others - even when they claim to be compliant with the VESA specs. VGA still only gives you a fairly low-res screen for text. I'd LOVE to see a 160x100 text screen, but my laptop won't support it Sad
Post 30 Jul 2004, 15:11
View user's profile Send private message Visit poster's website Reply with quote
Gomer73



Joined: 29 Nov 2003
Posts: 151
Gomer73 30 Jul 2004, 18:50
Why don't you just set it to gui 1600x1200 and then do the characters using bitmaps?
Fairly easy to do(especially if it supports a 4 bit mode) and quick enough on todays computers.
Post 30 Jul 2004, 18:50
View user's profile Send private message Reply with quote
ASHLEY4



Joined: 28 Apr 2004
Posts: 376
Location: UK
ASHLEY4 30 Jul 2004, 20:52
Crc, I have tested my vesa code on at lest 20 pc and all work as they should, there are small things you need to check for eg: if using 640x480x16.8m (vesa 112h) some computers (usually Compaq) use 24bit per pixel, others use 32bits per pixel.
Also Gomer73 is right, to emulat text mode with a vesa graphic mode works very well.
I used it untill, geting my swiching to real-mode and back code working.
\\\\|////
(@@)
ASHLEY4.
Post 30 Jul 2004, 20:52
View user's profile Send private message Reply with quote
amiflat



Joined: 27 Jul 2004
Posts: 8
Location: Italy
amiflat 07 Aug 2004, 15:22
I ASHLEY4,

can you post your tutorial, please?

I'm trying to move all code from my laptop to another PC for better test vesa. Currently i'm on simple mode 13h 320x200 vga testing the fastest way to put a pixel on screen.

Bye
Best regarrds
amiflat
Post 07 Aug 2004, 15:22
View user's profile Send private message Reply with quote
ASHLEY4



Joined: 28 Apr 2004
Posts: 376
Location: UK
ASHLEY4 07 Aug 2004, 20:18
Latter tonight i will post some commants on how to set up vesa.

\\\\|////
(@@)
ASHLEY4.


Last edited by ASHLEY4 on 08 Sep 2004, 16:35; edited 1 time in total
Post 07 Aug 2004, 20:18
View user's profile Send private message Reply with quote
ASHLEY4



Joined: 28 Apr 2004
Posts: 376
Location: UK
ASHLEY4 08 Aug 2004, 18:43
New info on its Smile.

\\\\|////
(@@)
ASHLEY4.


Last edited by ASHLEY4 on 08 Sep 2004, 16:38; edited 1 time in total
Post 08 Aug 2004, 18:43
View user's profile Send private message Reply with quote
amiflat



Joined: 27 Jul 2004
Posts: 8
Location: Italy
amiflat 09 Aug 2004, 10:25
Very Happy

Thank you very much.
I will post very soon code in other assembler language for translating in flat assember

thank you again

best regards
amiflat
Post 09 Aug 2004, 10:25
View user's profile Send private message Reply with quote
ASHLEY4



Joined: 28 Apr 2004
Posts: 376
Location: UK
ASHLEY4 09 Aug 2004, 18:39
Please note that if you have down loaded the above zip "VesaDemo.zip" ,when you have finished with the demo, you can use the disk to boot your own OS or test part of your OS.
By simpley assembling your OS as a mz exe and calling it kernel32.exe and put it on the disk, Instead of the one with the demo and reboot, it will boot and run the exe.
Do not use dos int's and start your code in realmode and then go to pmode,if you want to.
\\\\|////
(@@)
ASHLEY4.
Post 09 Aug 2004, 18:39
View user's profile Send private message Reply with quote
amiflat



Joined: 27 Jul 2004
Posts: 8
Location: Italy
amiflat 11 Aug 2004, 09:49
Smile
Hi ASHLEY4
This is a fast way to put pixel in pascal/asm can you translate in Flat?

Thank you
P.S.
Your vesademo rock's Wink

Best regards

Fast PutPixel Code (use fewer clock cicle)
Procedure Putpixel (X,Y : Integer; Col : Byte; where:word);
{ This puts a pixel on the screen by writing directly to memory. }
BEGIN
Asm
push ds {; Make sure these two go out the }
push es {; same they went in }
mov ax,[where]
mov es,ax {; Point to segment of screen }
mov bx,[X]
mov dx,[Y]
push bx {; and this again for later}
mov bx, dx {; bx = dx}
mov dh, dl {; dx = dx * 256}
xor dl, dl
shl bx, 1
shl bx, 1
shl bx, 1
shl bx, 1
shl bx, 1
shl bx, 1 {; bx = bx * 64}
add dx, bx {; dx = dx + bx (ie y*320)}
pop bx {; get back our x}
add bx, dx {; finalise location}
mov di, bx {; di = offset }
{; es:di = where to go}
xor al,al
mov ah, [Col]
mov es:[di],ah {; move the value in ah to screen
point es:[di] }
pop es
pop ds
End;
END;
Post 11 Aug 2004, 09:49
View user's profile Send private message Reply with quote
amiflat



Joined: 27 Jul 2004
Posts: 8
Location: Italy
amiflat 11 Aug 2004, 09:50
Procedure Putpixel (X,Y : Integer; Col : Byte; where:word); assembler;
{ This puts a pixel on the screen by writing directly to memory. }
Asm
mov ax,[where]
mov es,ax
mov bx,[X]
mov dx,[Y]
mov di,bx
mov bx, dx {; bx = dx}
shl dx, 8
shl bx, 6
add dx, bx {; dx = dx + bx (ie y*320)}
add di, dx {; finalise location}
mov al, [Col]
stosb
End;


Function Getpixel (X,Y : Integer; where:word):byte; assembler;
{ This puts a pixel on the screen by writing directly to memory. }
Asm
mov ax,[where]
mov es,ax
mov bx,[X]
mov dx,[Y]
mov di,bx
mov bx, dx {; bx = dx}
shl dx, 8
shl bx, 6
add dx, bx {; dx = dx + bx (ie y*320)}
add di, dx {; finalise location}
mov al, es:[di]
End;
Post 11 Aug 2004, 09:50
View user's profile Send private message Reply with quote
ASHLEY4



Joined: 28 Apr 2004
Posts: 376
Location: UK
ASHLEY4 12 Aug 2004, 01:24
This code has not been test.
Code:
Putpixel:   mov     ax,word[where]   mov     es,ax   mov     bx,word[X]   mov     dx,word[Y]   mov     di,bx   mov     bx,dx                     shl     dx,8   shl     bx,6   add     dx,bx                    add     di,dx                     mov     al,byte[Col]   stosb  ret  Getpixel:   mov     ax,word[where]   mov     es,ax   mov     bx,word[X]   mov     dx,word[Y]   mov     di,bx   mov     bx,dx                    shl     dx,8   shl     bx,6   add     dx,bx                     add     di,dx                     mov     al,[es:di]   retwhere      dw  0x          dw  0y          dw  0col        db  0    


Note: Fill in the var before calling proc.

\\\\|////
(@@)
ASHLEY4.
Post 12 Aug 2004, 01:24
View user's profile Send private message Reply with quote
amiflat



Joined: 27 Jul 2004
Posts: 8
Location: Italy
amiflat 12 Aug 2004, 08:43
NO DOUBT
YOU ARE A FAST LIKE ASSEMBLER

Smile

thank you

best regards

Questions:
1) How can get the putpixel proc more fast in vesa?
2) What you think about people that would make a personal operating system?
Post 12 Aug 2004, 08:43
View user's profile Send private message Reply with quote
ASHLEY4



Joined: 28 Apr 2004
Posts: 376
Location: UK
ASHLEY4 12 Aug 2004, 16:18
Quote:
Questions:
1) How can get the putpixel proc more fast in vesa?
2) What you think about people that would make a personal operating system?


1) I can not answer this, as most of my time is put into get vesa to work well, once i am happy with the way my os works, than i would work on making it faster.
A games programmer will know more, also try reading this book: Michael Abrash's classic Graphics Programming Black Book . you can down load all chapters from here: http://public.planetmirror.com/pub/gpbb/
A bit old, but still the best book on graphic optimising and speed.

2) That they are people who like to have complet control, Even if the thing they control is not as good as thing they do not control.
Most would make good entrepreneur's , Defiantly not sheep ,leaders etc.

\\\\|////
(@@)
ASHLEY4.
Post 12 Aug 2004, 16:18
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  
Goto page 1, 2  Next

< 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.