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? | ||||||||||||||
|
||||||||||||||
Total Votes : 15 |
Author |
|
rhyno_dagreat 11 Oct 2006, 18:00
Or, better yet, I think anyone should be able to add their knowledge to it, even us newbies to it.
|
|||
11 Oct 2006, 18:00 |
|
vid 11 Oct 2006, 18:15
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...
|
|||
11 Oct 2006, 18:15 |
|
rhyno_dagreat 11 Oct 2006, 23:52
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.
|
|||
11 Oct 2006, 23:52 |
|
smiddy 12 Oct 2006, 02:36
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/ |
|||
12 Oct 2006, 02:36 |
|
f14t 18 Oct 2006, 09:30
How do i have to say Yes or No to you ?
|
|||
18 Oct 2006, 09:30 |
|
Dex4u 18 Oct 2006, 17:18
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.
|
|||
18 Oct 2006, 17:18 |
|
rhyno_dagreat 19 Oct 2006, 00:33
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.
|
|||
19 Oct 2006, 00:33 |
|
Dex4u 19 Oct 2006, 01:21
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 |
|||
19 Oct 2006, 01:21 |
|
rhyno_dagreat 19 Oct 2006, 01:36
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.
|
|||
19 Oct 2006, 01:36 |
|
Mac2004 19 Oct 2006, 03:50
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 |
|||
19 Oct 2006, 03:50 |
|
Redragon 19 Oct 2006, 18:13
i am also in favor very much! i think its a very good idea
|
|||
19 Oct 2006, 18:13 |
|
rhyno_dagreat 20 Oct 2006, 04:04
Mac2004 wrote: I am in favor of rhyno_dagreat's idea... 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:
|
|||
20 Oct 2006, 04:04 |
|
Mac2004 20 Oct 2006, 15:14
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 |
|||
20 Oct 2006, 15:14 |
|
Dex4u 20 Oct 2006, 17:48
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. |
|||
20 Oct 2006, 17:48 |
|
rhyno_dagreat 20 Oct 2006, 19:02
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.
|
|||
20 Oct 2006, 19:02 |
|
Niels 21 Oct 2006, 11:47
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. |
|||
21 Oct 2006, 11:47 |
|
rhyno_dagreat 21 Oct 2006, 19:08
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. |
|||
21 Oct 2006, 19:08 |
|
Klod 29 Oct 2006, 04:02
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! |
|||
29 Oct 2006, 04:02 |
|
Dex4u 29 Oct 2006, 15:42
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 .
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 . 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 |
|||
29 Oct 2006, 15:42 |
|
Goto page 1, 2 Next < Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.