Working on the OS FAQ [Mega-Tokyo Wiki]

All about the OSDev Wiki. Discussions about the organization and general structure of articles and how to use the wiki. Request changes here if you don't know how to use the wiki.
User avatar
Solar
Member
Member
Posts: 7615
Joined: Thu Nov 16, 2006 12:01 pm
Location: Germany
Contact:

Re:Working on the OS FAQ

Post by Solar »

Go ahead and edit the pages wherever you think information is outdated and missing! Your submissions will be peer-reviewed, but you don't need any up-front clearing to submit your knowledge.
Every good solution is obvious once you've found it.
DruG5t0r3

Re:Working on the OS FAQ

Post by DruG5t0r3 »

I've added a section under the wiki regarding debuging with gdb and qemu.

Enjoy :)
AR

Re:Working on the OS FAQ

Post by AR »

There seems to be a flaw with Can I use some language other than C?
can you invoke code coming from raw data bytes with XYZ ? (that'll be mandatory for loading and running programs)
Is it me or does this rule out just about everything other than Assembly? Inline Assembly aside, Function Pointers don't really cut it for task switching.
User avatar
Solar
Member
Member
Posts: 7615
Joined: Thu Nov 16, 2006 12:01 pm
Location: Germany
Contact:

Re:Working on the OS FAQ

Post by Solar »

The page is indeed phrased a bit awkwardly. Even C cannot simply "jump to X and execute", unless the code at X is aware of the C function calling discipline. The point is that this discipline is what is considered "standard". So the question is as much "can you interface with C" as it is about "can you interface with ASM"...

I did two minor adjustments in phrasing; feel free to add / modify, I'm a bit busy atm...
Every good solution is obvious once you've found it.
Xardfir

Re:Working on the OS FAQ

Post by Xardfir »

Hiya,
I was poking around the OSFAQ and noticed the DMA page was buried in the wishlist section. Having way too much time on my hand's I heavily edited it and made a few additions.
The original text from Inglorion is still on the end of the page for the code examples.
I made reference to things that actually work on the DMA controller and the constraints that DMA programming has to deal with (only in first physical 16Mbytes , no more than 64k on 8bit transfers, 128k on 16 bit transfers etc.)....
A bit more work and more elaborate examples would flesh it out a bit and one day it might grow up to be in the main FAQ!
User avatar
Candy
Member
Member
Posts: 3882
Joined: Tue Oct 17, 2006 11:33 pm
Location: Eindhoven

Re:Working on the OS FAQ

Post by Candy »

Solar wrote: The page is indeed phrased a bit awkwardly. Even C cannot simply "jump to X and execute",

Code: Select all

(void (*X)())();
right?
User avatar
bubach
Member
Member
Posts: 1223
Joined: Sat Oct 23, 2004 11:00 pm
Location: Sweden
Contact:

Re:Working on the OS FAQ

Post by bubach »

@Xardfir: Good work. I guess the text from Inglorion's page was just temporary. I tried to clean it up a bit..
"Simplicity is the ultimate sophistication."
http://bos.asmhackers.net/ - GitHub
User avatar
Solar
Member
Member
Posts: 7615
Joined: Thu Nov 16, 2006 12:01 pm
Location: Germany
Contact:

Re:Working on the OS FAQ

Post by Solar »

Candy wrote:
Solar wrote: The page is indeed phrased a bit awkwardly. Even C cannot simply "jump to X and execute",

Code: Select all

(void (*X)())();
right?
I might be wrong, but that's a call, isn't it? I can't look up the standard right now, but is that guaranteed to not do anything fishy (i.e. implementation-defined) with the stack?
Every good solution is obvious once you've found it.
User avatar
Candy
Member
Member
Posts: 3882
Joined: Tue Oct 17, 2006 11:33 pm
Location: Eindhoven

Re:Working on the OS FAQ

Post by Candy »

Solar wrote:
Candy wrote:
Solar wrote: The page is indeed phrased a bit awkwardly. Even C cannot simply "jump to X and execute",

Code: Select all

(void (*X)())();
right?
I might be wrong, but that's a call, isn't it? I can't look up the standard right now, but is that guaranteed to not do anything fishy (i.e. implementation-defined) with the stack?
Well, yes, that would normally constitute a call which in a normal world should not change anything on the stack. However, as I can show (my OS is good at it), you can switch stacks within a C function. It can look kind of messy, but if you just don't return, nothing's going wrong whatever you do.

In other words, that constitutes a jump to a location you just specify.
zloba

Re:Working on the OS FAQ

Post by zloba »

If XYZ fits the other points and is an interpreted language then, can you invoke code coming from raw data bytes with XYZ, i.e. jump at a specific address and continue execution there?
IMO this is redundant, because:
"If XYZ fits the other points", among which is "interfacing with assembly", then you can jump and invoke and interface all you like, since you can do it in assembly!

so "interfacing with assembly" is a sufficient condition. IMO. (for being able to do things)
unless you can invoke every needed instruction without assembly, in which case your language IS assembly, or a superset of it ;)
Are you able to build a self-sufficient run-time library to support language features you'll need ?
this is not so much about being able to build a RTL, but about being able to plug it into the language, and to get rid of the standard one. IMO.
and is an interpreted language
where does the _interpreter_ fit in this picutre? (or is it considered part of its runtime?)
you would need to port an interpreter AND runtime/whatever it needs to bare hardware. (unless a port already exists)
and if you are capable of running your stuff on bare hardware, then you don't need these things explained to you... ;)
---

how's about:
-can your language interface with assembly, or otherwise accomplish everything that needs to be done? (specific memory layout, bits and bytes, registers, ports, etc.)
< can it do the job? >
-can programs in your language run on bare hardware? in case of interpreted languages, can the interpreter either run on bare hardware, or compile into assembly/binary that can?
< can you make it work in such environment? >
User avatar
Brendan
Member
Member
Posts: 8561
Joined: Sat Jan 15, 2005 12:00 am
Location: At his keyboard!
Contact:

Re:Working on the OS FAQ

Post by Brendan »

Hi,

How do you log into the Wiki, so it knows who's making changes? I tried using the same login details as this forum, but that doesn't seem to work...

BTW I added a new "Time and Date" page which will hopefully help (I saw it on the wishlist and was in the mood for starting it)... :)
http://www.osdev.org/osfaq2/index.php/TimeDate

BTW2 I also accidentally trashed the FloppyDriver page and then restored it to the previous/correct version. It's all fixed - I hope this won't matter or effect anything, and you all have my apologies in any case!


Cheers,

Brendan
For all things; perfection is, and will always remain, impossible to achieve in practice. However; by striving for perfection we create things that are as perfect as practically possible. Let the pursuit of perfection be our guide.
User avatar
Colonel Kernel
Member
Member
Posts: 1437
Joined: Tue Oct 17, 2006 6:06 pm
Location: Vancouver, BC, Canada
Contact:

Re:Working on the OS FAQ

Post by Colonel Kernel »

Brendan wrote: Hi,

How do you log into the Wiki, so it knows who's making changes? I tried using the same login details as this forum, but that doesn't seem to work...
You need to create a page with a wiki-word for the name with which you intend to sign in. For example, you could create a page called BrendanTrotter, then use that name to sign in before making changes to the rest of the wiki. No password is required.
Top three reasons why my OS project died:
  1. Too much overtime at work
  2. Got married
  3. My brain got stuck in an infinite loop while trying to design the memory manager
Don't let this happen to you!
Xardfir

Re:Working on the OS FAQ

Post by Xardfir »

Hiya,
Completed the DMA page on the ToDo list, including improved code examples. I deliberately didn't put too many C examples in because the ASM examples are easily translated to outb() format.
Apart from any (unintentional) mispellings or wierd numbers it should be ready for the main FAQ.
Xardfir

Re:Working on the OS FAQ

Post by Xardfir »

Hiya,
I just noticed a question about the 'A20 line' in the forum and noticed in the OSFAQ that there is no mention of the Pentium+ Fast A20 option in the 'Why can't I access all my memory?' page.
I have split the page into pre-pentium and post-pentium and added the code (all three lines of it!) to show how to switch the A20 line without bothering with the keyboard controller.
In additon I have added a shortened version of Dark Fiber's code based on info in The Undocumented PC.
There is an interesting page http://www.win.tue.nl/~aeb/linux/kbd/A20.html
dedicated to the A20 line and all it's wierdness, including BIOS routines that can switch A20 and a wierdism from Minix saying to send 0xFF of all things to the keyboard controller (0x64)! I have added the page link to the end of the A20 section and taken a copy for my own records.
blip

Re:Working on the OS FAQ

Post by blip »

I would like to point out an error, serious depending on how much the reader knows, at http://www.osdev.org/osfaq2/index.php/BootSequence
After the subtitle "Master Boot Record" the addresses given are quite incorrect as is that of the checksum. The MBR/bootsector is usually loaded to addresses 0:7C00h or 7C0h:0, both addresses on the page have an *extra* zero. The code following is correct however. The 0AA55h checksum word is always located at offest 1FEh of the sector *regardless* of sector size, though another copy of it is allowed at the end of the sector too. I see no further errors.

Good luck guys and gals!
Post Reply