Page 1 of 2
Weevil (planned)
Posted: Thu Feb 05, 2015 3:20 pm
by Vik2015
Finally I started working on my own operating system
. I want it to be like MS-DOS except it will not have any graphical apps (only text games
). Currently there is nothing but the VGA driver. Maybe somebody can take a look at the code so I be sure that it contains no errors?
Gitrepo is here
https://github.com/Vik2015/weevil/.
P. S. I hope my scrolling function is ok?
Re: Weevil (planned)
Posted: Thu Feb 05, 2015 3:56 pm
by seuti
Maybe you should have different directories for different platforms, just in case you wanted to expand in the future.
Re: Weevil (planned)
Posted: Fri Feb 06, 2015 1:45 am
by Roman
Move your strlen function to a separate file, e.g. string.c
Re: Weevil (planned)
Posted: Fri Feb 06, 2015 3:24 am
by Vik2015
Ok, thanks guys. Repo updated
Re: Weevil (planned)
Posted: Fri Feb 06, 2015 3:58 am
by Roman
Vik2015 wrote:Ok, thanks guys. Repo updated
You should place arch-dependent source files into arch/${ARCH}, arch-independent in the root of src.
Re: Weevil (planned)
Posted: Fri Feb 06, 2015 4:14 am
by Vik2015
Roman wrote:Vik2015 wrote:Ok, thanks guys. Repo updated
You should place arch-dependent source files into arch/${ARCH}, arch-independent in the root of src.
Uhh, not sure what do you mean. Something like this?
Code: Select all
/ #These files are platform-independent. Makefile can be run as `make i686' && `make ...' && ...
Makefile
grub.cfg
# Not sure about those two - they may be platform dependent
boot.asm
linker.ld
i686/
src/
kernel.c
...
.../
src/
...
Re: Weevil (planned)
Posted: Fri Feb 06, 2015 4:22 am
by Nable
Roman wrote:You should place arch-dependent source files into arch/${ARCH}, arch-independent in the root of src.
Topicstarter wants smth like MS-DOS, due to this fact I think that portability and expandable architecture aren't planned at all.
Of course, I should mention this starting point:
http://wiki.osdev.org/Beginner_Mistakes .
And one more:
http://wiki.osdev.org/Getting_Started .
Re: Weevil (planned)
Posted: Fri Feb 06, 2015 4:24 am
by Roman
Vik2015 wrote:Roman wrote:Vik2015 wrote:Ok, thanks guys. Repo updated
You should place arch-dependent source files into arch/${ARCH}, arch-independent in the root of src.
Uhh, not sure what do you mean. Something like this?
Code: Select all
/ #These files are platform-independent. Makefile can be run as `make i686' && `make ...' && ...
Makefile
grub.cfg
# Not sure about those two - they may be platform dependent
boot.asm
linker.ld
i686/
src/
kernel.c
...
.../
src/
...
Code: Select all
Makefile
grub.cfg
linker.ld # Can be dependent.
arch/
/x86
/...
main.c
All assembly files are arch-dependent, C files can be different, e.g. your VGA driver is arch-dependent, string.c - no.
Re: Weevil (planned)
Posted: Fri Feb 06, 2015 4:26 am
by Roman
Nable wrote:Roman wrote:You should place arch-dependent source files into arch/${ARCH}, arch-independent in the root of src.
Topicstarter wants smth like MS-DOS, due to this fact I think that portability and expandable architecture aren't planned at all.
Of course, I should mention this starting point:
http://wiki.osdev.org/Beginner_Mistakes .
And one more:
http://wiki.osdev.org/Getting_Started .
His OS is already unlike DOS: written in C, 32-bit and protected.
Re: Weevil (planned)
Posted: Fri Feb 06, 2015 5:12 am
by BrightLight
Vik2015 wrote:[...] I want it to be like MS-DOS
So it will be a 16-bit DOS-like OS? It's quite odd you're using GRUB for that though.
Re: Weevil (planned)
Posted: Fri Feb 06, 2015 5:25 am
by Vik2015
omarrx024 wrote:Vik2015 wrote:[...] I want it to be like MS-DOS
So it will be a 16-bit DOS-like OS? It's quite odd you're using GRUB for that though.
Well, I didn't want to create my own bootloader (thought I know how - using BIOS calls to read/load sectors, etc.). I am also gonna *try* to write it using only real mode (64kb memory should be enough I guess?) but without using any BIOS calls (or just minimal amount of them).
P. S. It is my first OS dev project after all, don't expect me to be a pro && understand everything
Re: Weevil (planned)
Posted: Fri Feb 06, 2015 5:31 am
by BrightLight
Vik2015 wrote:Well, I didn't want to create my own bootloader (thought I know how - using BIOS calls to read/load sectors, etc.). I am also gonna *try* to write it using only real mode (64kb memory should be enough I guess?) but without using any BIOS calls (or just minimal amount of them).
You should see
this page. It explains on how to switch between 32-bit and 16-bit mode, so you can use BIOS interrupts for disk access. It's also good because your system probably won't be multitasking, seeing it's DOS-like. If you don't want to do this, see
Virtual 8086 Mode, which allows you to execute 16-bit code in a 32-bit environment.
For a beginner, the first link is easier to follow.
Re: Weevil (planned)
Posted: Fri Feb 06, 2015 6:17 am
by iansjack
Rather than all the kludging with 16-bit and/or Virtual 8086 mode, why not just write a proper disk driver?
Re: Weevil (planned)
Posted: Fri Feb 06, 2015 6:25 am
by BrightLight
iansjack wrote:Rather than all the kludging with 16-bit and/or Virtual 8086 mode, why not just write a proper disk driver?
Because he wants a DOS-like OS, which probably means it would be 16-bit.
Re: Weevil (planned)
Posted: Fri Feb 06, 2015 6:52 am
by Muazzam
iansjack wrote:Rather than all the kludging with 16-bit and/or Virtual 8086 mode, why not just write a proper disk driver?
A single driver is not enough for IDE hard disk, SATA, USB, floppy etc. But a one BIOS interrupt can do that.