flat assembler
Message board for the users of flat assembler.

Index > OS Construction > OS Development?

Goto page Previous  1, 2, 3, 4
Author
Thread Post new topic Reply to topic
Tyler



Joined: 19 Nov 2009
Posts: 1216
Location: NC, USA
Tyler 03 Jun 2010, 02:31
No 500h:0 is an example pointer that could be placed in offset 9*4. You can put any value you want there, but it should point to your handler code. In the word(2 bytes) at 9*4 you put the segment, then you put the offset within that segment in the next word(which would be at (9*4) + 2).

The link I gave explains better.
Post 03 Jun 2010, 02:31
View user's profile Send private message Reply with quote
baldr



Joined: 19 Mar 2008
Posts: 1651
baldr 03 Jun 2010, 06:01
Tyler,

You don't have to guess (and you're wrong): processor manuals say that IVT consists of far pointers, dw offset, selector.

----8<----
MeshNix,

Interrupts can be masked using EFLAGS.IF too. Interrupt handler is invoked similar to pushf / call far [0:4*int_no] (there is no such addressing mode though).

----8<----
ManOfSteel,

IVT can be relocated using lidt on 286+ for debugging/monitoring/virtualization stuff. That's where handlers' chaining can be useful.
Post 03 Jun 2010, 06:01
View user's profile Send private message Reply with quote
Tyler



Joined: 19 Nov 2009
Posts: 1216
Location: NC, USA
Tyler 03 Jun 2010, 06:37
Oops, I read the table at the link I gave left to right. baldr's right. I read left to right assuming the leftmost was at 0 offset within the dword.
Post 03 Jun 2010, 06:37
View user's profile Send private message Reply with quote
adroit



Joined: 21 Feb 2010
Posts: 252
adroit 03 Jun 2010, 17:57
baldr wrote:
MeshNix,

Interrupts can be masked using EFLAGS.IF too. Interrupt handler is invoked similar to pushf / call far [0:4*int_no] (there is no such addressing mode though).

To get this clear: we cannot access the interrupt flags like registers, so we use cli to clear IF. When we cleared it; it won't handle maskable interrupts (which I think are software interrupts).
If it is cleared, then it handle IRQs, instead of interrupt calls (eg. int 21h).
Post 03 Jun 2010, 17:57
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20621
Location: In your JS exploiting you and your system
revolution 03 Jun 2010, 18:03
IF only affects IRQ hardware interrupts. Software interrupts always happen regardless of the state of IF.
Post 03 Jun 2010, 18:03
View user's profile Send private message Visit poster's website Reply with quote
adroit



Joined: 21 Feb 2010
Posts: 252
adroit 03 Jun 2010, 18:33
Oh, Okay. Thanks, revolution.
Post 03 Jun 2010, 18:33
View user's profile Send private message Reply with quote
adroit



Joined: 21 Feb 2010
Posts: 252
adroit 09 Jun 2010, 21:04
Video
-------

I have a few questions on OS dev.

I'm using Real Mode (for ease), and I don't want to use BIOS interrupts to print characters. My OS is to support CLI and GUI.

How does GUI actually work? (Such as: mouse, icons, linking files to icons, updating time, etc. -- the works!)
Post 09 Jun 2010, 21:04
View user's profile Send private message Reply with quote
edfed



Joined: 20 Feb 2006
Posts: 4354
Location: Now
edfed 09 Jun 2010, 21:55
actually, GUI are various.
mainly, the gui is a big set of functions, sorted in a librairy.

files are not linked to icons, icons are linked to files.

the mouse is an object, with its own datas.
several functions in a gui uses the mouse datas as global datas.
then, the mouse is a global object, always at the same place. int33h for dos, [mouse] for me, and anywhere else for anybody.
that's what i like here, nobody code the same thing or the same way, it is named diversity, the main feature of the nature is evolutive diversity.

but try to explain GUI in one post is... a little too much.

you can already do some graphix and text programming without bios ints.
especially mode 3 that doesn't require any int10h to be used, because it is always the boot video mode.

then, just use a segment to point to text memory, and write to it.
Post 09 Jun 2010, 21:55
View user's profile Send private message Visit poster's website Reply with quote
adroit



Joined: 21 Feb 2010
Posts: 252
adroit 10 Jun 2010, 03:29
Merci.
GUI Libraries sound hard to implement.

edfed wrote:
you can already do some graphix and text programming without bios ints.
especially mode 3 that doesn't require any int10h to be used, because it is always the boot video mode.

then, just use a segment to point to text memory, and write to it.

Very Happy Excellent!
.... Would VESA (SVGA) be most preferable for GUI in Real mode?
Post 10 Jun 2010, 03:29
View user's profile Send private message Reply with quote
baldr



Joined: 19 Mar 2008
Posts: 1651
baldr 10 Jun 2010, 06:09
MeshNix wrote:
Would VESA (SVGA) be most preferable for GUI in Real mode?
VBE seems to be the only bearable option (you don't expect drivers from IHVs for your OS coming soon, do you? Wink). Unless you'll stick with standard VGA modes.

Graphic mode programming isn't a big problem if you don't care about performance too much.
Post 10 Jun 2010, 06:09
View user's profile Send private message Reply with quote
adroit



Joined: 21 Feb 2010
Posts: 252
adroit 17 Jun 2010, 01:52
I care about performance, but I would like to some how have great grafix.
How exactly does a library work on an OS.
Post 17 Jun 2010, 01:52
View user's profile Send private message Reply with quote
baldr



Joined: 19 Mar 2008
Posts: 1651
baldr 17 Jun 2010, 02:14
MeshNix,

I mean performance via hardware acceleration.

Which library? What OS?
Post 17 Jun 2010, 02:14
View user's profile Send private message Reply with quote
Tyler



Joined: 19 Nov 2009
Posts: 1216
Location: NC, USA
Tyler 17 Jun 2010, 02:43
All you need is to provide a way to access video. As an OS, you can do as little as to allow every program control it's own GUI with direct pixel access, or you could do as much as provide windows with objects and all that. You can provide nothing or everything. It's a choice of what you want your OS to be like, do you want to be like Windows with a easily identifiable very standard look, or would you like to allow the GUI to be customized by individual apps(Like with Linux, which has X and many window managers that run on top of X.)? Windows Explorer or X + some window manager? There's no standard way to do it, it's all personal opinion.

What is hardware acceleration?
Post 17 Jun 2010, 02:43
View user's profile Send private message Reply with quote
ManOfSteel



Joined: 02 Feb 2005
Posts: 1154
ManOfSteel 17 Jun 2010, 09:53
Tyler wrote:
What is hardware acceleration?

Seriously? 2D and 3D graphic acceleration by the GPU. Something that requires an interface providing users with an access to the video hardware (e.g. DRI for unices), which in turn requires a special driver that communicates with a specific type/model of graphic chipset. The GPU industry being among the most closed and secretive ones in the personal computing business, you can't really hope to have such a driver unless you have a "compatibility" layer in your OS that allows you to use their binary blobs.
The only remaining option for an amateur OS is to use VESA, but the performance even for the most basic 2D graphics will be as terrible as using a dedicated driver and disabling hardware acceleration completely.
Post 17 Jun 2010, 09:53
View user's profile Send private message Reply with quote
cod3b453



Joined: 25 Aug 2004
Posts: 618
cod3b453 17 Jun 2010, 11:36
It's quite easy to make a simple 2D library for VESA LFB; you can even expand it to render 3D as well but the performance is likely to be poor. If you're not familiar with graphics programming, there are several good books on it - I believe the reference used at university was "Computer Graphics Principles and Practice" by Foley, van Dam, Feiner & Hughes.

----

Both AMD and Intel have opened up some of their specs for hardware acceleration:

http://www.x.org/docs/AMD/

http://www.x.org/docs/intel/

I've not read any of these but hopefully they are useful to someone.
Post 17 Jun 2010, 11:36
View user's profile Send private message Reply with quote
edfed



Joined: 20 Feb 2006
Posts: 4354
Location: Now
edfed 17 Jun 2010, 13:36
in real mode, only one graphic mode is really cool and fast (and reliable), mode 13h. and maybe 640*480 is cool too, but very slow.

deal in real time with palette to obtain the maximal color diversity.

don't forget to design your graphix functions for future ehancements like BPP increase (mode 320*200 32bpp, vesa), bpsl increase (changing resolution), etc.
Post 17 Jun 2010, 13:36
View user's profile Send private message Visit poster's website Reply with quote
adroit



Joined: 21 Feb 2010
Posts: 252
adroit 18 Jun 2010, 14:22
baldr wrote:
Which library? What OS?

I'm not referring to any specific library on an OS. I just wanted to know what was a library, and how did it work on an OS for GUI.
Does it have macro codes for stuff like printing graphic texts (fonts)?
Does it have codes to handle the mouse? What does a library do?

Tyler wrote:
It's a choice of what you want your OS to be like, do you want to be like Windows with a easily identifiable very standard look, or would you like to allow the GUI to be customized by individual apps(Like with Linux, which has X and many window managers that run on top of X.)?

'Multi-styles' is better but, I think a single standard is easier to implement. I think I would allow applications to be able to alter the GUI window by using scripts to use images to create window skins (or something like that [just a thought])
cod3b453 wrote:
I've not read any of these but hopefully they are useful to someone

cod3b453, thanks for the links. They're GREAT -- although I really don't understand a thing (just browsed through). But I guess I have to reserve some time to read them, when I'm ready to setup my GUI environment

edfed, thanks man. Mode 13h is really cool.
Post 18 Jun 2010, 14:22
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  
Goto page Previous  1, 2, 3, 4

< 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.