flat assembler
Message board for the users of flat assembler.

Index > OS Construction > Very good OS tutorial

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



Joined: 12 Aug 2005
Posts: 12
odysseus 12 Aug 2005, 12:28
I've finished to learn assembler some month ago and i'd like to enter the OS programming world, but i haven't found good tutorials...
so, can you give me some advise on where can i found them or on OS programming, please?
Post 12 Aug 2005, 12:28
View user's profile Send private message Reply with quote
Night Rider



Joined: 28 Jul 2005
Posts: 72
Night Rider 12 Aug 2005, 14:30
Andrew Tannenbaum's books. I don't think that any NET tutorial will teach you creating OS well. You need to know theoretical parts.
Post 12 Aug 2005, 14:30
View user's profile Send private message ICQ Number Reply with quote
odysseus



Joined: 12 Aug 2005
Posts: 12
odysseus 12 Aug 2005, 14:56
oh...
thanks
Post 12 Aug 2005, 14:56
View user's profile Send private message Reply with quote
odysseus



Joined: 12 Aug 2005
Posts: 12
odysseus 12 Aug 2005, 15:12
could you advise me a simple OS to analyze, please?
Post 12 Aug 2005, 15:12
View user's profile Send private message Reply with quote
Night Rider



Joined: 28 Jul 2005
Posts: 72
Night Rider 12 Aug 2005, 15:33
Look for Linux (C code) 0.12 it illustrates many methods. Versions after 012 are complicated, earlier versions has bad-formatted code, it is hard tounderstand ideas. MEOS, ofcourse (early versions). There is a lot of OSes over the net. A very lot of. Try tinyOs or FLOPOS. MINIX has VERY understandable C code! (BTW it is made by A.T. Smile
Post 12 Aug 2005, 15:33
View user's profile Send private message ICQ Number Reply with quote
odysseus



Joined: 12 Aug 2005
Posts: 12
odysseus 12 Aug 2005, 15:43
thanks, but i'd like to start with a basic 100% ASM OS..,
I'll search over the net.
Post 12 Aug 2005, 15:43
View user's profile Send private message Reply with quote
bogdanontanu



Joined: 07 Jan 2004
Posts: 403
Location: Sol. Earth. Europe. Romania. Bucuresti
bogdanontanu 12 Aug 2005, 16:40
Post 12 Aug 2005, 16:40
View user's profile Send private message Visit poster's website Reply with quote
odysseus



Joined: 12 Aug 2005
Posts: 12
odysseus 12 Aug 2005, 16:43
thanks
Post 12 Aug 2005, 16:43
View user's profile Send private message Reply with quote
Dex4u



Joined: 08 Feb 2005
Posts: 1601
Location: web
Dex4u 12 Aug 2005, 17:37
I think you may get a bit lost in Solar and menuet as theres lots of code, i think you may be better off looking at http://bos.asmhackers.net/
As its got all the basic with out the eyecandy and theres lots of doc on the site that may help too.


Last edited by Dex4u on 12 Aug 2005, 20:33; edited 1 time in total
Post 12 Aug 2005, 17:37
View user's profile Send private message Reply with quote
Night Rider



Joined: 28 Jul 2005
Posts: 72
Night Rider 12 Aug 2005, 18:06
Quote:

thanks, but i'd like to start with a basic 100% ASM OS..,

Don't afraid. To CATCH IDEAS, Linux 0.12 fits very well, trust me! And this kernel is well-documented, it is quite simple.
Post 12 Aug 2005, 18:06
View user's profile Send private message ICQ Number Reply with quote
odysseus



Joined: 12 Aug 2005
Posts: 12
odysseus 14 Aug 2005, 11:44
THANKS!
Post 14 Aug 2005, 11:44
View user's profile Send private message Reply with quote
odysseus



Joined: 12 Aug 2005
Posts: 12
odysseus 14 Aug 2005, 12:03
* Night Rider: I downloaded the 0.01 version, it has less code, Smile
* Dex4u: I downloaded BOS
--Thanks
Post 14 Aug 2005, 12:03
View user's profile Send private message Reply with quote
odysseus



Joined: 12 Aug 2005
Posts: 12
odysseus 14 Aug 2005, 16:17
probably this questions are very stupid, but how can i call the kernel by the bootloader and what extension should they have?
Post 14 Aug 2005, 16:17
View user's profile Send private message Reply with quote
Night Rider



Joined: 28 Jul 2005
Posts: 72
Night Rider 14 Aug 2005, 16:35
Quote:

Night Rider: I downloaded the 0.01 version, it has less code

I warned you - 0.12 is better to understand. 0.01 is like web comparing to 0.12
Next. Call ? with far jump i think. Extension? I doesn't matter, you decide yourself...
Post 14 Aug 2005, 16:35
View user's profile Send private message ICQ Number Reply with quote
odysseus



Joined: 12 Aug 2005
Posts: 12
odysseus 14 Aug 2005, 16:43
Quote:

I warned you - 0.12 is better to understand. 0.01 is like web comparing to 0.12
Next. Call ? with far jump i think.

thanks.

Quote:

Extension? It doesn't matter, you decide yourself...

so i can compile boot.asm and kernel.asm as *.bin?
Post 14 Aug 2005, 16:43
View user's profile Send private message Reply with quote
odysseus



Joined: 12 Aug 2005
Posts: 12
odysseus 14 Aug 2005, 17:12
can anyone tell me if this code is correct:

bootsector.asm:

Code:
USE16
ORG 7C00h
RESET:
        MOV AH, 0
        INT 013h
        OR AH, AH
        JNZ RESET

        MOV AX, 0
        MOV ES, AX
        MOV BX, 1000h

        MOV AH, 02h
        MOV AL, 02h
        MOV CH, 0
        MOV CL, 02h
        MOV DH, 0
        INT 013h
        OR AH, AH
        JNZ RESET

        CLI

        XOR AX, AX
        MOV DS, AX

        LGDT [GDT_DESC]

        MOV EAX, CR0
        OR EAX, 1
        MOV CR0, EAX

        JMP 08h:CLEAR_PIPE

USE32
CLEAR_PIPE:
        MOV AX, 010h
        MOV DS, AX
        MOV SS, AX
        MOV ESP, 090000h

        JMP 08h:01000h

GDT:

GDT_NULL:
        DD 0
        DD 0

GDT_CODE:
        DW 0FFFFh
        DW 0
        DB 0
        DB 10011010b
        DB 11001111b
        DB 0

GDT_DATA:
        DW 0FFFFh
        DW 0
        DB 0
        DB 10010010b
        DB 11001111b
        DB 0

GDT_END:

GDT_DESC:
        DW GDT_END-GDT-1
        DD GDT

TIMES 510 - ($ - $$) DB 0

        DW 0AA55h
    


kernel.asm:

Code:
;-----Memory---------------------------------
TXT_osname      DB "K.O.S."
;############################################
;-----Main-----------------------------------
KERN:
        MOV SI, TXT_osname
        CALL PRINT
HANG:
        JMP HANG
;############################################
;-----Print:---------------------------------
PRINT:
        MOV AH, 0Eh
        MOV BH, 07h
        MOV BL, 09h
        NEXT:
        LODSB
        CMP AL, 0
        JE RETURN
        INT 010h
        JMP NEXT
        RETURN:
        RET
;############################################
    
Post 14 Aug 2005, 17:12
View user's profile Send private message Reply with quote
odysseus



Joined: 12 Aug 2005
Posts: 12
odysseus 15 Aug 2005, 12:06
so, please?
Post 15 Aug 2005, 12:06
View user's profile Send private message Reply with quote
shoorick



Joined: 25 Feb 2005
Posts: 1614
Location: Ukraine
shoorick 15 Aug 2005, 12:57
i'm not os constructor, but logically: when you insert floppy and reset pc the first sector is loaded and executed.
1. you try to enter PM in it, but do not search and load kernel from floppy
2. you omit bpb - in this you make incompatible floppy, thus it is still possible to operate with disk, but with full own support.
3. if you finally load your kernel it seems it is 16-bit application, when you plan to be already in PM.

this all is not a solution, but you can check these moments. regards!
Post 15 Aug 2005, 12:57
View user's profile Send private message Visit poster's website Reply with quote
Mac2004



Joined: 15 Dec 2003
Posts: 314
Mac2004 15 Aug 2005, 16:01
Hi!

So you are trying to make 2 stage boot loader code. Smile I would suggest that you add this code to the beginning of kernel.asm

Code:
MOV AX, 1000h 
        MOV DS, AX 
        MOV ES, AX 
    


And you should have code like this:
Code:

        MOV AX, 1000h ;set ds and es 
        MOV DS, AX 
        MOV ES, AX 


KERN: 
        MOV SI, TXT_osname 
        CALL PRINT 
HANG: 
        JMP HANG 
;############################################ 
;-----Print:--------------------------------- 
PRINT: 
        MOV AH, 0Eh 
        MOV BH, 07h 
        MOV BL, 09h 
        NEXT: 
        LODSB 
        CMP AL, 0 
        JE RETURN 
        INT 010h 
        JMP NEXT 
        RETURN: 
        RET 
;############################################

TXT_osname      DB "K.O.S." 

    


This code sets up DS and ES and makes them point where you want to load your secondary biinary file. Org doesn't work. I've tried it Confused

Regards
Mac2004
Post 15 Aug 2005, 16:01
View user's profile Send private message Reply with quote
odysseus



Joined: 12 Aug 2005
Posts: 12
odysseus 16 Aug 2005, 10:31
thank!
another question:
do i have to use 'section' directive or i can do not use it?
Post 16 Aug 2005, 10:31
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-2025, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.