Click HereClick Here
home features news forums classifieds faqs links search
5151 members 
Amiga Q&A /  Free for All /  Emulation /  Gaming / (Latest Posts)
Login

Nickname

Password

Lost Password?

Don't have an account yet?
Register now!

Support Amigaworld.net
Your support is needed and is appreciated as Amigaworld.net is primarily dependent upon the support of its users.
Donate

Menu
Main sections
» Home
» Features
» News
» Forums
» Classifieds
» Links
» Downloads
Extras
» OS4 Zone
» IRC Network
» AmigaWorld Radio
» Newsfeed
» Top Members
» Amiga Dealers
Information
» About Us
» FAQs
» Advertise
» Polls
» Terms of Service
» Search

IRC Channel
Server: irc.amigaworld.net
Channel: #Amigaworld
Channel Policy and Guidelines

(Uses JAVA Applet and Port 1024)
Visit the Chatroom Website

Who's Online
 50 guest(s) on-line.
 3 member(s) on-line.


 VooDoo,  terminills,  Amigo1

You are an anonymous user.
Register Now!
 Amigo1:  7 secs ago
 terminills:  1 min ago
 VooDoo:  1 min ago
 number6:  5 mins ago
 AmigaPapst:  7 mins ago
 AmigaMac:  8 mins ago
 AndreasM:  8 mins ago
 ribdevil:  8 mins ago
 Arnie:  10 mins ago
 zipper:  10 mins ago

/  Forum Index
   /  Amiga Development
      /  Amiga Library Structure
Register To Post

Goto page ( Previous Page 1 | 2 )
PosterThread
startup-sequence.bat 
Re: Amiga Library Structure
Posted on 10-May-2012 22:31:03
#21 ]
Member
Joined: 6-Apr-2012
Posts: 16
From: Unknown

@Franko

Well, at least I don't end each of my sentence with a smiley to hypocritically pretend I'm being nice when I'm in fact smearing my interlocutor.

I'm a nice guy so I'm going to pretend that you are not being extremely rude but you may want to take a long hard look at yourself.

 Status: Offline
Profile     Report this post  
Franko 
Re: Amiga Library Structure
Posted on 10-May-2012 22:45:33
#22 ]
Elite Member
Joined: 29-Jun-2010
Posts: 2809
From: Unknown

@startup-sequence.bat

Quote:

startup-sequence.bat wrote:
@Franko

Well, at least I don't end each of my sentence with a smiley to hypocritically pretend I'm being nice when I'm in fact smearing my interlocutor.

I'm a nice guy so I'm going to pretend that you are not being extremely rude but you may want to take a long hard look at yourself.


Wassa matta with smilies...

I like Smilies...

I've had this conversation before here somewhere...

I don't pretend to be nice, in fact I've never claimed to be nice, I'm just a grumpy auld fart who hates and despises everybody and everything...

Can't take a long hard look at meself, as everytime I tried the mirror broke...

I'm not extremely rude I'm just Scottish...

Now if you want extremely rude then you should've met my granny, boy... she could make Bernard Manning blush with her put downs...

PS: I never smeared anything on your interlocutor, must've been someone else who did that as I wouldn't touch it with a bargepole... :-0

_________________

 Status: Offline
Profile     Report this post  
tonyw 
Re: Amiga Library Structure
Posted on 11-May-2012 0:11:05
#23 ]
Elite Member
Joined: 8-Mar-2003
Posts: 2779
From: Sydney (of course)

@startup-sequence.bat

More modern OSes maintain a list of all resources that a program opens, uses and closes. Thus, when that program exits, libraries can be closed, memory released, etc, if the program crashes, the programmer is lazy or the program has not done its homework.

AmigaOS does not track resources in user programs, thus the OS can not clean up after a lazy program. We expect every man to do his duty.

_________________
cheers
tony

Hyperion Support Forum: http://forum.hyperion-entertainment.biz/index.php

 Status: Offline
Profile     Report this post  
Hypex 
Re: Amiga Library Structure
Posted on 11-May-2012 15:30:05
#24 ]
Elite Member
Joined: 6-May-2007
Posts: 5279
From: Greensborough, Australia

@Belxjander

That was quite extensive. But you forgot this:

struct Library{ struct Node lib_Node; UBYTE lib_Flags; UBYTE lib_ABIVersion; /* ABI exported by library */ UWORD lib_NegSize; /* number of bytes before library */ UWORD lib_PosSize; /* number of bytes after library */ UWORD lib_Version; /* major */ UWORD lib_Revision; /* minor */ APTR lib_IdString; /* ASCII identification */ ULONG lib_Sum; /* the checksum itself */ UWORD lib_OpenCnt; /* number of current opens */}; /* Warning: size is not a longword multiple! */

Okay OS4 version but you get my point.

 Status: Offline
Profile     Report this post  
Hypex 
Re: Amiga Library Structure
Posted on 11-May-2012 15:35:54
#25 ]
Elite Member
Joined: 6-May-2007
Posts: 5279
From: Greensborough, Australia

@NutsAboutAmiga

I think this is a bad example:

1.) It uses a move.l to put a zero in D0 instead of a moveq.
2.) It doesn't check the result. An address register move doesn't affect CCs. And relying on the system is to test the result for you is a bad assumption.
3.) It later then uses a moveq.
4.) It doesn't cache ExecBase but that wasn't the worse IMO.

Last edited by Hypex on 11-May-2012 at 03:38 PM.

 Status: Offline
Profile     Report this post  
Hypex 
Re: Amiga Library Structure
Posted on 11-May-2012 15:37:32
#26 ]
Elite Member
Joined: 6-May-2007
Posts: 5279
From: Greensborough, Australia

@startup-sequence.bat

What is opened must be closed. The only main exception would be a resource.

And BTW those three lines send up as only three instructions.

 Status: Offline
Profile     Report this post  
Belxjander 
Re: Amiga Library Structure
Posted on 11-May-2012 16:17:28
#27 ]
Regular Member
Joined: 4-Jan-2005
Posts: 463
From: Chiba prefecture Japan

@Hypex

I was giving overview... but thank you for the reminder of the details...can't ever slip over those without being sure to specify them all now ;)

 Status: Offline
Profile     Report this post  
NutsAboutAmiga 
Re: Amiga Library Structure
Posted on 15-May-2012 18:19:58
#28 ]
Elite Member
Joined: 9-Jun-2004
Posts: 8607
From: Norway

@Hypex

The example was something I found googleing for hello world and assembler, just added comments add fixed some major mistakes, like not setting the D0 value at all.

http://helloworldsite.he.funpic.de/hello.htm

A better example probably use the LVO values:


; Hello World in 68000 Assembler for dos.library (Amiga)

_LVOOpenLibrary EQU -552
_LVOCloseLibrary EQU -414
_LVOOutput EQU -60
_LVOWrite EQU -48
_LVOWriteChars EQL -142

move.l 4,a6 ; get exec lib base address
move.l #DOS,a1 ; library name
moveq #0,d0 ; library verson
jsr _LVOOpenLibrary(a6) ; Call IEXEC::OpenLibrary
tst.l d0 ; d0 should of been set, if the open lib succeeded. This is testing if d0, is set to 0
beq.s .Out ; if openlibrary failed quit
move.l d0,a6 ; move D0 to A6 to use DOS.library

move.l #HelloWorld,d1 ; string to write
jsr _LVOPutStr(a6) ; call IDOS::PutStr

move.l a6,a1 ; library to close (dos.library)
move.l 4,a6 ; get exec.library
jsr _LVOCloseLibrary(a6) ; call IEXEC::CloseLibrary
.Out rts

DOS dc.b 'dos.library',0
HelloWorld dc.b 'Hello World!',$A,0


http://cd.textfiles.com/amigaformat/aformat-01-19960509/Demos/Secal/Inc/lvos/

Last edited by NutsAboutAmiga on 15-May-2012 at 09:21 PM.
Last edited by NutsAboutAmiga on 15-May-2012 at 07:09 PM.
Last edited by NutsAboutAmiga on 15-May-2012 at 07:02 PM.
Last edited by NutsAboutAmiga on 15-May-2012 at 06:58 PM.
Last edited by NutsAboutAmiga on 15-May-2012 at 06:53 PM.
Last edited by NutsAboutAmiga on 15-May-2012 at 06:44 PM.
Last edited by NutsAboutAmiga on 15-May-2012 at 06:44 PM.
Last edited by NutsAboutAmiga on 15-May-2012 at 06:42 PM.

_________________
Software developer and forum troll.
Please check out my software:
Excalibur, Basilisk 2, AmigaInputAnywhere.

 Status: Offline
Profile     Report this post  
startup-sequence.bat 
Re: Amiga Library Structure
Posted on 19-May-2012 16:16:25
#29 ]
Member
Joined: 6-Apr-2012
Posts: 16
From: Unknown

@NutsAboutAmiga

You should use lea DOS(pc), a1, not move.l #DOS, a1.
I'm pretty sure the former will result in a single 16bit instruction word, whereas that move would require a whopping 6 bytes of machine code!

As a result, depending on the specific cpu it may take as much as a 2 fewer cycles to fetch the instruction. Furthermore, it would take less space in the instruction cache.

Also, when loading the executable, by using a PC relative addressing mode, it's one less address relocation that the os needs to perform!

Lastly, if some day amiga os implements memory protection, having position independent code is useful to have so you can map the same library images at different addresses in different processes, so it's a good habit to take.

Plus if you're going to write assembly code, you may as well squeeze out every possible cycle. Who would want to use a poorly optimized hello world?

 Status: Offline
Profile     Report this post  
Belxjander 
Re: Amiga Library Structure
Posted on 19-May-2012 16:20:55
#30 ]
Regular Member
Joined: 4-Jan-2005
Posts: 463
From: Chiba prefecture Japan

@startup-sequence.bat

the Amiga OS *already* impliments a dynamic memory layout... so your suggested improvements at this time are dissengenious as to "more modern" features...

as for "memory protection" would you be dealing with blocking reads or only blocking writes?

 Status: Offline
Profile     Report this post  
startup-sequence.bat 
Re: Amiga Library Structure
Posted on 19-May-2012 16:37:08
#31 ]
Member
Joined: 6-Apr-2012
Posts: 16
From: Unknown

@Belxjander

You post suggests a lack of understanding of mine. I suggest re-reading my previous post repeatedly until you acquire wisdom or faint from thirst, whichever comes first.

 Status: Offline
Profile     Report this post  
Deniil715 
Re: Amiga Library Structure
Posted on 19-May-2012 18:31:30
#32 ]
Elite Member
Joined: 14-May-2003
Posts: 3590
From: Sweden

@startup-sequence.bat

Quote:
You post suggests a lack of understanding of mine. I suggest re-reading my previous post repeatedly until you acquire wisdom or faint from thirst, whichever comes first.


Hahaha

AmigaOS 4 does have memory protection, but not task based such yet. Free and non-mapped mem and null pages are read&write&execute protected and const data such as litteral C "strings" are write protected and executable code can only be executed, not read or written which means self-modifying code will cause an exception.

Garbage collection is kind of difficult to implement due to AmigaOS' inherent shared library and memory model. It is allowed for one task to open a library or allocate memory and then quit and let another task to close and free it later.

_________________
>Amiga Classic and OS4 developer for OnyxSoft.
>A1-XE/G4, Radeon9250, Sweex 5.1, SII680
-Don't hesitate to contact me about my programs, but please use e-mail instead of PM. E-mails are more likely to be read in time, and easier for me to keep track of.

 Status: Offline
Profile     Report this post  
RodTerl 
Re: Amiga Library Structure
Posted on 19-May-2012 19:56:20
#33 ]
Cult Member
Joined: 6-Sep-2004
Posts: 521
From: Rossendale

Um, so the exec, memory protection basis of AOS is like having a security guard at the entrance to the factory complex, whose only job is to punch you in and out again, instead of being given a seperate area full of area monitors and remotely operated locks to cubicles, lifts, doors, bathrooms, TV, vending machines, and the commitees bar?

How hard would it be to build this totally seperate room for AOS, as long as every program has to do an OS call to be able to do anything? If a resource is requested, doesnt that mean it is already tracked, even if teh result is just NULL instead of a guy with a clipboard and access code?

_________________
The older and more respected a scientist is, the longer it takes to prove him wrong.

 Status: Offline
Profile     Report this post  
NutsAboutAmiga 
Re: Amiga Library Structure
Posted on 19-May-2012 20:12:25
#34 ]
Elite Member
Joined: 9-Jun-2004
Posts: 8607
From: Norway

@RodTerl

First of all you get a bunch of angry users whit hay forks, screaming this and that crashes or does not work.

It will be complex to do that, because now programs just execute library routines whit out thinking about instant variables whit in the library, for this work every library has to task switch to the library in order to allow writing and reading instant variables, other operating systems do this whit a interrupt and this taken care of some how, also many programs allocate wrong memory for arguments and pass pointers to local variables to system libraries and devices.


Last edited by NutsAboutAmiga on 19-May-2012 at 08:29 PM.
Last edited by NutsAboutAmiga on 19-May-2012 at 08:13 PM.

_________________
Software developer and forum troll.
Please check out my software:
Excalibur, Basilisk 2, AmigaInputAnywhere.

 Status: Offline
Profile     Report this post  
Goto page ( Previous Page 1 | 2 )

[ home ][ about us ] [ forums ][ classifieds ] [ links ][ news archive ] [ link to us ][ user account ]
Copyright © 2000 - 2011 Amigaworld.net.

Page took 0.102037 seconds to load.