Welcome, Guest. Please login or register.

Author Topic: Any tutorials/articles on OS-ports ?  (Read 2998 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline EinsteinTopic starter

  • Sr. Member
  • ****
  • Join Date: Dec 2004
  • Posts: 402
    • Show all replies
Any tutorials/articles on OS-ports ?
« on: December 28, 2004, 03:24:58 PM »
Hello again, Elvis has entered the building ..


Issue: ports

I need tutorials/articles/help on these OS ports, what are these things ? my "Amiga Machine Language" (from abacus) is a good book to learn some OS programming but unfortunately it includes some ports in the source codes without A SINGLE explenation on what these are and when to add them.
I've written some code for disk-sector reading/writing etc. but whenever I run it kinda works the first time, the secong time I run it (even after reassambling) nothing happens, does this have to do with ports ?
I have spoken !
 

Offline EinsteinTopic starter

  • Sr. Member
  • ****
  • Join Date: Dec 2004
  • Posts: 402
    • Show all replies
Re: Any tutorials/articles on OS-ports ?
« Reply #1 on: December 29, 2004, 05:20:34 PM »
source goes here:

opendev:
   lea   trddevname,a0
   lea   diskio,a1
   moveq   #0,d0         ; unit = 0
   moveq   #0,d1         ; no flags (?)
   move.l   4,a6
   jsr   -444(a6)      ; OpenDevice()
   rts

closedev:
   lea   diskio,a1
   move.l   4,a6
   jsr   -450(a6)      ; CloseDevice()
   rts

motoron:
   moveq   #1,d0         ; motor on
   bra   motOnOff

motoroff:
   moveq   #0,d0         ; motor off
   bra   motOnOff

motOnOff:
   lea   diskio,a1
   move.w   #9,28(a1)      ; command: motor..
   move.l   d0,36(a1)      ; ..on/off
   bra   sendio

read:
   lea   diskio,a1
   move.w   #2,28(a1)      ; command: read
   move.l   #512*2,36(a1)      ; length
   move.l   #readbuff,40(a1)   ; pointer to read-buffer
   move.l   #512*0,44(a1)      ; disk offset
   bra   sendio

sendio:
   move.l   4,a6
   jsr   -462(a6)      ; sendIo()
   rts

trddevname:
   dc.b   'trackdisk.device',0
   even

diskio:
   blk.l   20,0

readbuff:
   blk.b   512*2


** END_OF_CODE **

it's ment to be an include file !
I have spoken !
 

Offline EinsteinTopic starter

  • Sr. Member
  • ****
  • Join Date: Dec 2004
  • Posts: 402
    • Show all replies
Re: Any tutorials/articles on OS-ports ?
« Reply #2 on: December 29, 2004, 05:53:07 PM »
Thanks for the reply.

Believe me, I WOULD do it proper if I only knew what I was doing, forexample this ports, I really want to know what these are, yesterday I was browsing threu an old CU Amiga mag from 1992, a page came up, it was the third part of an arexx tutorial, it briefly explained a few stuff about ports, something My asm-book (Amiga Machine Language) fails to even consider doing, it was very logical as far as I got it, and as I understand it ports are:

pieces of code that handle the (event) messages one is waiting for, so ones program (task) may "sleep" and "wake up" when the port is called (in order to free the OS from the task that would otherwise do nothing but wait for the message).

I am on the right path ?

Also It would really help alot if you had any link that would explain this so I could get a 100% accurate understanding of what I'm actually doing.

Thanks again.
I have spoken !
 

Offline EinsteinTopic starter

  • Sr. Member
  • ****
  • Join Date: Dec 2004
  • Posts: 402
    • Show all replies
Re: Any tutorials/articles on OS-ports ?
« Reply #3 on: December 29, 2004, 06:07:54 PM »
Thanks, but I hate all those standard includes you've got there  :oops: , any version without'em ?  :-P
I have spoken !
 

Offline EinsteinTopic starter

  • Sr. Member
  • ****
  • Join Date: Dec 2004
  • Posts: 402
    • Show all replies
Re: Any tutorials/articles on OS-ports ?
« Reply #4 on: December 30, 2004, 02:46:11 PM »
So piru, what does those includes contain besides symbols ?
and thanks for that link.

I have spoken !
 

Offline EinsteinTopic starter

  • Sr. Member
  • ****
  • Join Date: Dec 2004
  • Posts: 402
    • Show all replies
Re: Any tutorials/articles on OS-ports ?
« Reply #5 on: December 30, 2004, 02:48:22 PM »
@FluffyMcDeath, I dont do much C (frankly nothing at all for the moment), so asm is my prime choice for now. thanks for that link though, going to take a look. :)


*EDIT*

DO one need to BUY resources to learn to program the old 1.3 kickstart ? I need to learn the exec- and device-programmming inside & out, is it ILLEGAL to publish articles teaching those areas ?
I have spoken !
 

Offline EinsteinTopic starter

  • Sr. Member
  • ****
  • Join Date: Dec 2004
  • Posts: 402
    • Show all replies
Re: Any tutorials/articles on OS-ports ?
« Reply #6 on: January 04, 2005, 01:59:22 PM »
Hey dudes, could you give a list to the prime books concerning exec-, device-, task- and port-programming ? the books need to approach the respective areas with some (slight is enough) pedagogic point of view !
help me out here please !  :-)


*EDIT*

I'm browsing through this:

http://www.amazon.com/gp/reader/020156775X/ref=sib_rdr_zmin/103-4493694-5644624?%5Fencoding=UTF8&p=S001&j=1#reader-page

I wish I had the book in my hand right now ..  :-(
I have spoken !