flat assembler
Message board for the users of flat assembler.

Index > OS Construction > Idea: FASM OSDev Tutorial

Goto page 1, 2  Next

Should we have a OSDev Tutorial?
Yes
93%
 93%  [ 14 ]
No
6%
 6%  [ 1 ]
Total Votes : 15

Author
Thread Post new topic Reply to topic
rhyno_dagreat



Joined: 31 Jul 2006
Posts: 487
Location: Maryland, Unol Daleithiau
rhyno_dagreat
I think it would be great if some of the FASM OS devin' veterans could make a sort-of FASM OS Devin' tutorial sticky-post. I wish not to be flamed with this idea, for it is just an idea. Very Happy
Post 11 Oct 2006, 17:56
View user's profile Send private message Reply with quote
rhyno_dagreat



Joined: 31 Jul 2006
Posts: 487
Location: Maryland, Unol Daleithiau
rhyno_dagreat
Or, better yet, I think anyone should be able to add their knowledge to it, even us newbies to it.
Post 11 Oct 2006, 18:00
View user's profile Send private message Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid
not much chance for success... "veterans" usually have something to do already. also, OS-dev is too advanced thing for simple tutorial. For example i was writing some article about error handling for FASMLIB, even simpler one, insufficent for OS, and it ended with 13KB of pure text, still not done...
Post 11 Oct 2006, 18:15
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
rhyno_dagreat



Joined: 31 Jul 2006
Posts: 487
Location: Maryland, Unol Daleithiau
rhyno_dagreat
Well, it doesn't have to be a simple tutorial, but more or less a collective idea on how one can get started, and maybe delve into some theory behind it.
Post 11 Oct 2006, 23:52
View user's profile Send private message Reply with quote
smiddy



Joined: 31 Oct 2004
Posts: 559
smiddy
This site might be helpful: http://www.mega-tokyo.com/osfaq2/
And this one has some stuff: http://my.execpc.com/CE/AC/geezer/osd/index.htm
And lastly, chekc this one out: http://www.osdever.net/
Post 12 Oct 2006, 02:36
View user's profile Send private message Reply with quote
f14t



Joined: 27 Sep 2006
Posts: 36
f14t
How do i have to say Yes or No to you ?
Post 18 Oct 2006, 09:30
View user's profile Send private message Reply with quote
Dex4u



Joined: 08 Feb 2005
Posts: 1601
Location: web
Dex4u
I think most code who know enough to write a tut, would not write one, as they would not like to put there head above the parapet, as they still think of them selfs as beginners.
Post 18 Oct 2006, 17:18
View user's profile Send private message Reply with quote
rhyno_dagreat



Joined: 31 Jul 2006
Posts: 487
Location: Maryland, Unol Daleithiau
rhyno_dagreat
I'm thinking maybe we should come to a collective idea on this: Each adds what they know, and others will fill in their gaps. I.E. - Dex4u might know a thing or two about interrupts, but he doesn't know much about how to write to the harddrive, whereas Artlav might know how to write to a hard drive, yet doesn't know about graphics mode, where someone else will fill in on graphics mode and etc... (I hope you all don't mind me using your names, in which I know Dex4u does know a thing or two about both, and I'm sure Artlav knows about VESA and such.) But I hope you see what I'm saying.
Post 19 Oct 2006, 00:33
View user's profile Send private message Reply with quote
Dex4u



Joined: 08 Feb 2005
Posts: 1601
Location: web
Dex4u
I get your point rhyno_dagreat, but lets make them usefull, we should write working tut, that can also be added together to build a OS, it willbe based around a simple pmode OS, what do you think ? .
Each part will be self contained, so we endup with tuts that come with a bootable mouse demo or bootable gui demo or bootable fdd driver and so on.

But then again nobody would use them, so if you can get 30 people who want them, we will start making them.
Good luck Wink
Post 19 Oct 2006, 01:21
View user's profile Send private message Reply with quote
rhyno_dagreat



Joined: 31 Jul 2006
Posts: 487
Location: Maryland, Unol Daleithiau
rhyno_dagreat
I like it, and to your thoughts that no one would use it: so far we've had 9 hits on the polls, and not everyone's a poll user, so therefore there may be more out there.
Post 19 Oct 2006, 01:36
View user's profile Send private message Reply with quote
Mac2004



Joined: 15 Dec 2003
Posts: 313
Mac2004
I am in favor of rhyno_dagreat's idea...

Just an idea: Should there be a some sort of skeleton for the tutorial?

regards, Mac2004
Post 19 Oct 2006, 03:50
View user's profile Send private message Reply with quote
Redragon



Joined: 27 Nov 2004
Posts: 101
Location: U.S.
Redragon
i am also in favor very much! i think its a very good idea Very Happy
Post 19 Oct 2006, 18:13
View user's profile Send private message Reply with quote
rhyno_dagreat



Joined: 31 Jul 2006
Posts: 487
Location: Maryland, Unol Daleithiau
rhyno_dagreat
Mac2004 wrote:
I am in favor of rhyno_dagreat's idea...

Just an idea: Should there be a some sort of skeleton for the tutorial?

regards, Mac2004

You're right... once we get enough people saying they want this tutorial, then we can start coming up with a skeleton, but for now something to think about:

  • Making a bootable sector
  • Printing using the BIOS
  • Printing directly to video memory in 16-bit mode
  • Setting up a GDT and entering PMode
  • A quick introduction to input using ports (i.e. - in al, 60h)
  • Setting up interrupts
  • VGA mode
  • VESA mode
  • And the list can go on....
Post 20 Oct 2006, 04:04
View user's profile Send private message Reply with quote
Mac2004



Joined: 15 Dec 2003
Posts: 313
Mac2004
f14t wrote:
How do i have to say Yes or No to you ?


Do you mean how take part in voting?? In that case you should see voting options when you enter poll in question for the first time.

regards, Mac2004
Post 20 Oct 2006, 15:14
View user's profile Send private message Reply with quote
Dex4u



Joined: 08 Feb 2005
Posts: 1601
Location: web
Dex4u
My problem is how to make this series of tut, better than what is already available ?.
I mean most, if not all on the list is already available.
Post 20 Oct 2006, 17:48
View user's profile Send private message Reply with quote
rhyno_dagreat



Joined: 31 Jul 2006
Posts: 487
Location: Maryland, Unol Daleithiau
rhyno_dagreat
True, but I'm saying this for FASM... also, most tutorials out there are for C/C++ and not ASM. I'd like this to be for pure ASM in FASM, with maybe a single tutorial on how you can use C/C++/FreeBasic if you want to.
Post 20 Oct 2006, 19:02
View user's profile Send private message Reply with quote
Niels



Joined: 17 Sep 2006
Posts: 255
Niels
When knowing the points on the present list, one is still not able to create an OS.

Niels.


ps.
Me saying this cause Dex4u is right most points are already available online, although many times one can't speak of tutorial but rather a quick start and continue without knowing, this isn't always bad thing, too much info doesn't make an index. And of course rhyno_dagreat is right about the last point "and the list can go on....", the list should go on before one could speak of an OSdev tutorial(guide).

pps.
rhyno_dagreat wrote:
Quote:
with maybe a single tutorial on how you can use C/C++/FreeBasic if you want to.

That would probably be a very large single tutorial... A tutorial such as this.OSdev should use ASM only.
Post 21 Oct 2006, 11:47
View user's profile Send private message Reply with quote
rhyno_dagreat



Joined: 31 Jul 2006
Posts: 487
Location: Maryland, Unol Daleithiau
rhyno_dagreat
Niels wrote:
That would probably be a very large single tutorial... A tutorial such as this.OSdev should use ASM only.


You're probably right on that.
Post 21 Oct 2006, 19:08
View user's profile Send private message Reply with quote
Klod



Joined: 25 Nov 2003
Posts: 25
Location: Canada
Klod
How about using an existing OS like Menuet? Instead of an tutorial, create a Map of the components and where to find them in the source code.
Bootloader --> boot16.inc --> help file describing the workings of the code
Real mode to pmode --> file xyz.inc --> help file, describing the workings of the code
Kernel services --> kernel.inc --> help file describing the workings of the kernel
Keyboard --> keybord.inc etc

I have looked up a lot of the information on the net about Os dev but found it very hard to use in Os dev because there are many combinations of Assemblers and HLL languages which were used and I spent more time converting code examples from one language to the other. What about all the different design possibilities?

I picked Menuet because its source is open source and it is built with Fasm

_________________
Do not Assume, it makes an ASS out of U and ME!
Post 29 Oct 2006, 04:02
View user's profile Send private message Reply with quote
Dex4u



Joined: 08 Feb 2005
Posts: 1601
Location: web
Dex4u
I see you point klod, but one big problem is, the only person that can made such a tut , is the person that wrote the OS Crying or Very sad.
My idea is to use a simple realmode to Pmode core, along with a Com/exe bootloader, this way we can keep it simple and easy to understand Smile .
Example:
Code:
;**************************************************;; The swiching to and from pmode part of this      ;; code,is mostly the work of Christopher Giese.    ;; The rest is mostly by Dex.                       ;;                                                  ;; It can be assembled with fasm and maybe          ;; nasm ?.To assemble do this:                      ;; (c:\fasm VesaTest.asm kernel32.exe)              ;; You can run it from pure dos or from bootprog    ;; by Alexei A. Frounze (http://alexfru.chat.ru)    ;;                                                  ;; Thanks to Tomasz Grysztar (for fasm),Christopher ;; Giese,and any one else who has helped me.        ;;                                                  ;;**************************************************;format MZ        use16        jmp   start        linear_sel equ  linear_sel_1-gdt        sys_code   equ  sys_code_1-gdt        sys_data   equ  sys_data_1-gdt        Real_code  equ  Real_code_1-gdt        Real_data  equ  Real_data_1-gdtstart:        push  cs        pop   ds        mov   ax,ds        mov   es,ax;''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''';;                               This sets up going into pmode                 ;;.............................................................................;        xor   ebx,ebx        mov   bx,ds                            ; BX=segment        shl   ebx,4                            ; BX="linear" address of segment base        mov   eax,ebx        mov   [sys_code_1 + 2],ax              ; set base address of 32-bit segments        mov   [sys_data_1 + 2],ax        mov   [Real_code_1 + 2],ax             ; set base address of 16-bit segments        mov   [Real_data_1 + 2],ax        shr   eax,16        mov   [sys_code_1 + 4],al        mov   [sys_data_1 + 4],al        mov   [Real_code_1 + 4],al        mov   [Real_data_1 + 4],al        mov   [sys_code_1 + 7],ah        mov   [sys_data_1 + 7],ah        mov   [Real_code_1 + 7],ah        mov   [Real_data_1 + 7],ah        add   ebx,gdt                          ; EBX=linear address of gdt        mov   [gdtr + 2],ebx                cli                                    ; Disable interrupts,        mov   ax,cs        mov   [RealModeCS],ax        lgdt  [gdtr]                           ; Load the GDT descriptor        mov   eax, cr0                         ; Copy the contents of CR0 into EAX        or    eax, 1                           ; Set bit 0        mov   cr0, eax                         ; Copy the contents of EAX into CR0        jmp   10h:clear_pipe                   ; Jump to code segment, offset clear_pipeUSE32                                          ; We now need 32-bit instructionsclear_pipe:;'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''';;                                    We are in pmode                           ;;..............................................................................;       xor   edi,edi       xor   esi,esi       mov   ax, 18h                           ; Save data segment identifyer       mov   ds, ax                            ; Move a valid data segment into the data segment register       mov   ss, ax                            ; Move a valid data segment into the stack segment register       nop       mov   es,ax       mov   fs,ax       mov   gs,ax       mov   ax,linear_sel       mov   es,ax            jmp  $;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;                                         Data                                 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;JustInCase:         dd 0RealModeCS:         dw 0ridtr:   dw 0xFFFF                          ; limit=0xFFFF         dd 0                               ; base=0count1:  dw 0count:   db 0;:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::;;                                          GDT                                  ;;:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::;gdtr:   dw gdt_end - gdt - 1               ; GDT limit        dd gdt                             ; (GDT base gets set above)gdt:                                       ; Address for the gdt         dw 0                               ; limit 15:0    (0h) Null Segment        dw 0                               ; base 15:0        db 0                               ; base 23:16        db 0                               ; type        db 0                               ; limit 19:16, flags        db 0                               ; base 31:24linear_sel_1:          dw 0xFFFF                           ; (8h) linear Data segment, read/write, expand down       dw 0                                               db 0       db 10010010b                                       db 11001111b       db 0sys_code_1:                                ; (10h) Code segment, read/execute, nonconforming       dw 0FFFFh       dw 0       db 0       db 10011010b       db 11001111b       db 0sys_data_1:                                ; (18h) Data segment, read/write, expand down       dw 0FFFFh       dw 0       db 0       db 10010010b       db 11001111b       db 0Real_code_1:                               ; (20h) Real mode code segment       dw 0xFFFF       dw 0                                                     db 0       db 10011010b                                                      db 0       db 0Real_data_1:                               ; (28h) Real mode data segment       dw 0xFFFF       dw 0                                                      db 0       db 10010010b                                                      db 0       db 0gdt_end:                                   ; Used to calculate the size of the GDT    

This code is good because it not only boots from bootloader, but also dos, also it very easy to go to and from pmode to realmode.
Here are some example made from this basic code
http://www.dex4u.com/demos/DemoVesa.zip
The not only demos vesa, but also go to and from pmode to do bios int's

http://www.dex4u.com/pascal/BmpView.zip
This also demo vesa, but also loading a high res bmp image and displaying it.

And we can use this for boot loader http://alexfru.chat.ru/epm.html#bootprog
Post 29 Oct 2006, 15:42
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-2020, Tomasz Grysztar. Also on YouTube, Twitter.

Website powered by rwasa.