Tring to make an OS, need help.
Tring to make an OS, need help.
I am Tring to make an OS with its own File System, I need to learn how to make a boot code.
Here is a list of drivers I need:
Mouse
SoundBlaster 16
VGA 256 color 800X600
I am tring to make a nice command and visual OS, sort of like windows 95, 98SE.
I'm New and tring to make it with C (C-FREE 32-bit compiler)(MIRICLE C 16-bit compiler), BASIC (FIRST BASIC 16-bit compiler) (ASIC 16-bit compiler)
Here is a list of drivers I need:
Mouse
SoundBlaster 16
VGA 256 color 800X600
I am tring to make a nice command and visual OS, sort of like windows 95, 98SE.
I'm New and tring to make it with C (C-FREE 32-bit compiler)(MIRICLE C 16-bit compiler), BASIC (FIRST BASIC 16-bit compiler) (ASIC 16-bit compiler)
Re:Tring to make an OS, need help.
Hey
You will need to write the loader in assembly. You probably won't be able to use basic to do any of your kernel, either.
First, see the introduction section of this page from the FAQ, and this . Then you can look at this bootloader tut:"A hello world bootloader", and "Rolling your own boot loader" from the FAQ. Also see this.. It is a tutorial about making an OS, and it uses GRUB.
-Stephen
P.S. Wise words from the FAQ:
You will need to write the loader in assembly. You probably won't be able to use basic to do any of your kernel, either.
First, see the introduction section of this page from the FAQ, and this . Then you can look at this bootloader tut:"A hello world bootloader", and "Rolling your own boot loader" from the FAQ. Also see this.. It is a tutorial about making an OS, and it uses GRUB.
-Stephen
P.S. Wise words from the FAQ:
.It will likely take you several years, starting from scratch, to get to the point where you actually do a Graphical User Interface (GUI).
Re:Tring to make an OS, need help.
You could also try "bootprog" has a loader, as it can load a mz EXE or COM file.
http://alexfru.chat.ru/epm.html#bootprog
http://alexfru.chat.ru/epm.html#bootprog
Re:Tring to make an OS, need help.
I'd actually suggest grabbing an intel doc and heading down to www.mega-tokyo.com/osfaq2 and osdever.net, it's good to have a lot of information on how things work especially if you plan to go into protected mode (looks like you do).
Good luck,
Nelson
Good luck,
Nelson
Re:Tring to make an OS, need help.
I downloaded an assembly compiler I know the basic part of the code, but not how to make it boot the computer. What do I use a .bin, .boot, .exe or .com? If I want to not make an OS not in protected mode, what do I have to do? ??? :'(
Re:Tring to make an OS, need help.
the otput needs to be flat binary(.bin) then you got to swich to pmode:
(intel syntax)
then congragulation welcome to the world of pmode, as for loading your kernel use bios before pmode switch
Code: Select all
mov eax, cr0
or eax, 1
mov cr0, eax
then congragulation welcome to the world of pmode, as for loading your kernel use bios before pmode switch
Re:Tring to make an OS, need help.
My computer did not reconize mov Dose any one have an assembly compiler that works?
Re:Tring to make an OS, need help.
NASM or FASM work well.
NASM:
http://nasm.sourceforge.net/wakka.php?wakka=HomePage
FASM:
http://flatassembler.net/
NASM:
http://nasm.sourceforge.net/wakka.php?wakka=HomePage
FASM:
http://flatassembler.net/
Re:Tring to make an OS, need help.
FASM was the only one that worked on my PC, I could not download the other.
Now I am still stuck on the boot loader for my OS, any ideas?
Now I am still stuck on the boot loader for my OS, any ideas?
Re:Tring to make an OS, need help.
i think making your own boot sector is a bad place to start just use mine for now:
(nasm syntax)
this gets you in to pmode and loads the first 50 sectors(your kernel) and runs them
p.s. if you want i can explain what that code does
Code: Select all
;
; AndrewOS boot sector
; By Andrew Davis
; with LoadSectors func from tutorial by Matthew Blagden
[BITS 16]
[ORG 0x7C00]
jmp start
OSID db "AndrewOS"
BytesPerSector dw 0200h
SectorsPersector db 01h
LeadingSectors dw 0001h
NumberOfFATs db 02h
RootEntryMax dw 00E0h
TotalSectors dw 0B40h
MediaType db 0F0h
SectorsPerFAT dw 0009h
SectorsPerTrack dw 0012h
NumberOfHeads dw 0002h
HiddenSectors dd 00000000h
TotalSectors2 dd 00000000h
DriveNumber db 00h
Reserved db 00h
BootSignaure db 29h
VolumeID dd 69696969h
VolumeLabel db "AndrewOS "
FATID db "FAT12 "
LoadSectors:
push ax
push bx
push cx
mov dl, 12h
div dl
inc ah
mov cl, ah
mov dh, al
and dh, 01h
shr al, 1
mov ch, al
mov dl, 00h
Read:
mov ah, 02h
mov al, 01h
int 13h
jc Read
pop cx
pop bx
pop ax
add bx, 0200h
inc ax
loop LoadSectors
ret
start:
cli
mov ax, 07C0h
mov ds, ax
mov es, ax
mov ax, 9000h
mov ss, ax
mov sp, 0FFFFh
sti
floppy_reset:
mov ah, 0
int 13h
or ah, ah
jnz floppy_reset
kernel_load:
mov ax, 0
mov es, ax
mov bx, 0x1000
mov ax, 1
mov cx, 50
call LoadSectors
gdt:
cli
xor ax, ax
mov ds, ax
lgdt [toc]
pmode:
mov eax, cr0
or eax, 1
mov cr0, eax
jmp 08h:clean_up
[BITS 32]
clean_up:
mov ax, 10h
mov ds, ax
mov ss, ax
mov esp, 090000h
stop_floppy:
mov dx,3F2h
xor al,al
out dx,al
kernel:
jmp 08h:01000h
gdt_data:
dd 0
dd 0
dw 0FFFFh
dw 0
db 0
db 10011010b
db 11001111b
db 0
dw 0FFFFh
dw 0
db 0
db 10010010b
db 11001111b
db 0
end_of_gdt:
toc:
dw end_of_gdt - gdt_data - 1
dd gdt_data
times 510-($-$$) db 0
dw 0AA55h
this gets you in to pmode and loads the first 50 sectors(your kernel) and runs them
p.s. if you want i can explain what that code does
Re:Tring to make an OS, need help.
Well, a bootloader launching him into Protected Mode is of little help if he doesn't want to do Protected Mode...?!
I'd strongly suggest checking out the OS-FAQ in general, and the BabyStep tutorial in special. Also check out the various FAQ links provided above, and give the "QuickLinks" sticky thread of this board a try, too.
Nothing - your computer starts in Real Mode, and unless you tell it to do so it won't switch to protected mode.If I want to not make an OS not in protected mode, what do I have to do?
I'd strongly suggest checking out the OS-FAQ in general, and the BabyStep tutorial in special. Also check out the various FAQ links provided above, and give the "QuickLinks" sticky thread of this board a try, too.
Every good solution is obvious once you've found it.
Re:Tring to make an OS, need help.
sorry heres real mode version
Code: Select all
[BITS 16]
[ORG 0x7C00]
jmp start
LoadSectors:
push ax
push bx
push cx
mov dl, 12h
div dl
inc ah
mov cl, ah
mov dh, al
and dh, 01h
shr al, 1
mov ch, al
mov dl, 00h
Read:
mov ah, 02h
mov al, 01h
int 13h
jc Read
pop cx
pop bx
pop ax
add bx, 0200h
inc ax
loop LoadSectors
ret
start:
cli
mov ax, 07C0h
mov ds, ax
mov es, ax
mov ax, 9000h
mov ss, ax
mov sp, 0FFFFh
sti
floppy_reset:
mov ah, 0
int 13h
or ah, ah
jnz floppy_reset
kernel_load:
mov ax, 0
mov es, ax
mov bx, 0x1000
mov ax, 1
mov cx, 50
call LoadSectors
kernel:
jmp 0:01000h
times 510-($-$$) db 0
dw 0AA55h
Re:Tring to make an OS, need help.
Can any one tell me how to draw pitzles on the screen in assembly? >:)
frogive my spelling I am in a little hurry.
frogive my spelling I am in a little hurry.
Re:Tring to make an OS, need help.
What if I take out
[BITS 16]
[ORG 0x7C00]
and
[BITS 32]
The thing is my compiler dosn't allow it I am using fasm and masm. >:)
[BITS 16]
[ORG 0x7C00]
and
[BITS 32]
The thing is my compiler dosn't allow it I am using fasm and masm. >:)
Re:Tring to make an OS, need help.
[ORG 0x7C00], tells the asmbler were the code is in memory, this only works in nasm, for fasm use: see how well that works, as for bits if you like real mode you need 16-bit code:
Code: Select all
org 7C00h
Code: Select all
use16