Page 163 of 262

Re: What does your OS look like? (Screen Shots..)

Posted: Wed Sep 07, 2016 1:01 pm
by osdever
octacone wrote:Basic OS Update:
-Added PCI listing (oh god this took a while to implement, all those devices :roll: :roll: )
-Added RTC support (time + date)
-Added CPU Identification
-Added Graphics Identification
Wow! Cool :)

Re: What does your OS look like? (Screen Shots..)

Posted: Wed Sep 07, 2016 1:45 pm
by Octacone
catnikita255 wrote:
octacone wrote:Basic OS Update:
-Added PCI listing (oh god this took a while to implement, all those devices :roll: :roll: )
-Added RTC support (time + date)
-Added CPU Identification
-Added Graphics Identification
Wow! Cool :)
Thanks! :) :)
I had to do it anyways, working on an IDE controller.

Re: What does your OS look like? (Screen Shots..)

Posted: Wed Sep 07, 2016 1:55 pm
by crunch
brunexgeek wrote:Nothing much to see here. This is from a kernel I started a couple weeks to run on Raspberry Pi boards. This screenshot is from a physical memory allocation test using the new and delete C++ operators.
How easy is it to get your kernel booted up on the Pi? I have one sitting around and have been contemplating it.

Re: What does your OS look like? (Screen Shots..)

Posted: Wed Sep 07, 2016 4:37 pm
by brunexgeek
crunch wrote:
brunexgeek wrote:Nothing much to see here. This is from a kernel I started a couple weeks to run on Raspberry Pi boards. This screenshot is from a physical memory allocation test using the new and delete C++ operators.
How easy is it to get your kernel booted up on the Pi? I have one sitting around and have been contemplating it.
It's easy, actually. The Raspberry Pi firmware loads your kernel image from SD card (RPI 3 can use LAN or USB mass storage) at a specified memory address (0x8000 by default) e starts to run your code. The system also provides a mailbox interface which you can use to get information about the system (memory map, etc.) or change things (graphic resolution, etc.).

I'm using boot from LAN which speeds up the development, since we can't (yet?) emulate the board.

Re: What does your OS look like? (Screen Shots..)

Posted: Thu Sep 08, 2016 5:35 am
by Ycep
octacone wrote:
catnikita255 wrote:
octacone wrote:Basic OS Update:
-Added PCI listing (oh god this took a while to implement, all those devices :roll: :roll: )
-Added RTC support (time + date)
-Added CPU Identification
-Added Graphics Identification
Wow! Cool :)
Thanks! :) :)
I had to do it anyways, working on an IDE controller.
Using PCI IDE for reading hard drives and CDs is not braindead simple, except you copy code from wiki, through :D .
I already recommended you to have working memory manager and filesystem driver before going on other stuff. That stuff is one of the most important.

Re: What does your OS look like? (Screen Shots..)

Posted: Thu Sep 08, 2016 7:26 am
by Octacone
Lukand wrote: Using PCI IDE for reading hard drives and CDs is not braindead simple, except you copy code from wiki, through :D .
I already recommended you to have working memory manager and filesystem driver before going on other stuff. That stuff is one of the most important.
It is not that hard. I am coding an IDE driver just for fun, to learn how things work. Copying and pasting teaches you nothing, not recommended. I have a working memory manager, if you did not know. Next: a file system... first I need to be able to read/write from the hard drive and then implement a file system, then on top of that I need to write my very own virtual file system. Also PCI is crucial for some system specific features.

Re: What does your OS look like? (Screen Shots..)

Posted: Thu Sep 08, 2016 7:36 am
by BrightLight
Lukand wrote:Using PCI IDE for reading hard drives and CDs is not braindead simple, except you copy code from wiki, through :D .
I'd have to disagree here. PIO mode is very simple, just a few outb's, and you read back the data from the drive. DMA mode is slightly more difficult, but is mostly the same.

Re: What does your OS look like? (Screen Shots..)

Posted: Thu Sep 08, 2016 10:01 am
by Ycep
omarrx024 wrote:
Lukand wrote:Using PCI IDE for reading hard drives and CDs is not braindead simple, except you copy code from wiki, through :D .
I'd have to disagree here. PIO mode is very simple, just a few outb's, and you read back the data from the drive. DMA mode is slightly more difficult, but is mostly the same.
I meant writting whole IDE Controller Driver with DMA.
It isn't hard, but it's boring.
Few outb()? Two-three outb?
I meant braindead simple, which is easy like printing "hello world" on screen.
Let's refresh this topic by adding more screenshots.

Re: What does your OS look like? (Screen Shots..)

Posted: Thu Sep 08, 2016 10:48 am
by Octacone
Lukand wrote:
omarrx024 wrote:
Lukand wrote:Using PCI IDE for reading hard drives and CDs is not braindead simple, except you copy code from wiki, through :D .
I'd have to disagree here. PIO mode is very simple, just a few outb's, and you read back the data from the drive. DMA mode is slightly more difficult, but is mostly the same.
I meant writting whole IDE Controller Driver with DMA.
It isn't hard, but it's boring.
Few outb()? Two-three outb?
I meant braindead simple, which is easy like printing "hello world" on screen.
Let's refresh this topic by adding more screenshots.
More like 20 of them...
Being bored is not an excuse, if you really want to achieve something, you will most likely find a way to do it.
For example: I was delaying my PCI driver over and over... One day I really needed it, so I decided to spend like 30 hours and make one. The next day I did just that, it took me a little bit longer because I was having some bugs. After all it was worth it, if you really need/want something you must do it. If you are like super bored then better leave it for another day, broken code is worse than not having any. ;)

Re: What does your OS look like? (Screen Shots..)

Posted: Thu Sep 08, 2016 12:50 pm
by BrightLight
octacone wrote:More like 20 of them...
There aren't even 20 ATA registers, lol. :mrgreen:
There are only eight ATA registers (including the alternate status.)

Re: What does your OS look like? (Screen Shots..)

Posted: Thu Sep 08, 2016 1:02 pm
by Octacone
omarrx024 wrote:
octacone wrote:More like 20 of them...
There aren't even 20 ATA registers, lol. :mrgreen:
There are only eight ATA registers (including the alternate status.)
Registers? :D :D
I was talking about assembly calls such as: inportb, outportb, inportw, outportw, inportlong, outportlong... There are like 40 of those calls needed. :P

Re: What does your OS look like? (Screen Shots..)

Posted: Thu Sep 08, 2016 2:02 pm
by BrightLight
octacone wrote:Registers? :D :D
I was talking about assembly calls such as: inportb, outportb, inportw, outportw, inportlong, outportlong... There are like 40 of those calls needed. :P
No, there aren't that many needed. :roll:

Re: What does your OS look like? (Screen Shots..)

Posted: Thu Sep 08, 2016 2:05 pm
by Octacone
omarrx024 wrote:
octacone wrote:Registers? :D :D
I was talking about assembly calls such as: inportb, outportb, inportw, outportw, inportlong, outportlong... There are like 40 of those calls needed. :P
No, there aren't that many needed. :roll:
Count them for yourself. :D
I stopped at 20ish and approx. there are 40 of them.

Re: What does your OS look like? (Screen Shots..)

Posted: Thu Sep 08, 2016 2:07 pm
by BrightLight
octacone wrote:Count them for yourself. :D

Code: Select all

	; first we need to send the highest 4 bits of the lba to the drive select port
	mov eax, [.lba]
	shr eax, 24		; keep only highest bits
	or al, [.device]
	mov dx, [.io]
	add dx, 6		; drive select port
	out dx, al
	call iowait

	; sector count
	mov dx, [.io]
	add dx, 2		; 0x1F2
	mov eax, [.count]
	out dx, al

	; LBA
	inc dx			; 0x1F3
	mov eax, [.lba]
	out dx, al
	inc dx			; 0x1F4
	shr eax, 8
	out dx, al
	inc dx			; 0x1F5
	shr eax, 8
	out dx, al
	inc dx
	inc dx			; 0x1F7

	mov al, ATA_READ_LBA28
	out dx, al
	call iowait
Edit for clarification: I've done 6 OUTs to the ATA channel to perform a 28-bit LBA read here.

Re: What does your OS look like? (Screen Shots..)

Posted: Thu Sep 08, 2016 2:22 pm
by Octacone
@omarx024
Assembly... I was talking about this: wiki page full of C code
There are many port calls.