Oh, Samantha!

Hi there!

Samantha is back! After long period of hibernation in the AROS repository Sam440 port of AROS is maintained again. Big thanks to Markus Weiss, who has restarted it and to ACube who gave me the kick in the butt 🙂

Since the kernel.resource in AROS did evolved a bit since last time I was writing it form Sam, it has been updated a tiny bit now. Most of the features from Efika’s kernel have been back-ported to Sam440 port, including:

  • Loading and releasing of symbols from every ELF file loaded by AROS, including the kernel itself,
  • System call for cold reboot (accessible only from kernel.resource and exec.library),
  • Crash handler displays detailed information, including the byte offset of crash occurrence, relevant symbol name (if such name exists at all) and the executable name. The log includes also the backtrace (with offsets, symbol and module names) which tries to reach as far as possible.

Yes, I do know, it’s not much. But it is at least a good start (eerm…. rather a good re-birth?) :).

The Sam440 port has been not only extended, but also fixed a bit. I have found there an ancient bug in the exception handler. It could have lead to random system crashes. The reason was the exception handler itself. There was a risk that an interrupt will occur during reconstruction of the CPU context.

Since the AMCC440EP CPU does not maintain cache coherency (no, it’s not a bug, it’s a feature fairly well documented in the manuals!), some portions of the code had to be fixed. Now, more AROS code uses CachePreDMA and CachePostDMA pair of functions. Because of that partitions on harddrive are recognised properly now. AROS on Sam440 boots nicely and coexists with OS4.1 on the same harddrive. Nice, isn’t it?

Now, the last but not least, after some sleepless nights the OHCI driver of Poseidon is fixed and operates properly on Sam440ep. Wanna proof? Watch the attached screenshot 🙂

Stay tuned for more news. I promise to write a bit more now 😉

New (small) build


After a long break I present you herewith a new test iso for Efika. It’s much much smaller than all previous images, because I have not included the “contrib” build. The reason was instability of some third party MUI classes which either crashed the Zune preferences or did not allowed the prefs program to start.

The most important changes worth mentioning are USB fix, sync with current source tree and extended debug. The first fix repairs an anciend bug in OHCI driver, where the USB ports were powered up upon driver’s initialization. It lead to some “zombie” devices on the bus. The Efika source tree has been synced with the SVN repository too, therefore Efika build got all recent changes and updates from the main tree. The most important and Efika specific is extended debug. Until now, if anything on native aros crashed, I have had no clear information about the code that failed. Just some address in memory. Debugging under such conditions was so ineffective, that I’ve finally decided to improve the crash log a bit.

Now, every single module in the system registers itself at the kernel.resource with name and headers of ELF file. Kernel resource scans the file and remembers all symbols referring executable sections. The same is done with Kernel during the bootup too. Now, if a crash occurs, I become much more verbose information, which eventually helps 🙂 The information includes the location of crash (which byte offset, which function, which module) and the call backtrace up to the birth of the task/process. Have a look at NList crash:

[KRN] Exception 3 (DSI) handler. Context @ 0xff7fb948, SysBase @ 0x32c0, KernelBase @ 0x4bac
[KRN] Process 0xcae00 (Zune)
[KRN] Crash at byte 8 in func strcmp, module muimaster.library
[KRN] SRR0=00ed4428, SRR1=0000f030
[KRN] CTR=ff8066e4 LR=00e94270 XER=00000000 CCR=28004044
[KRN] DAR=00000013 DSISR=40000000
[KRN] HASH1=07000000 HASH2=070fffc0 IMISS=00ed4420 DMISS=00000013
ICMP=80000003 DCMP=80000000
[KRN] SPRG0=ff7fbaf0 SPRG1=00da9598 SPRG2=28004044 SPRG3=00000000
SPRG4=00004bac SPRG5=000032c0
[KRN] GPR00=00e80980 GPR01=002c9950 GPR02=00000000 GPR03=00da9598
[KRN] GPR04=00000013 GPR05=00da50c0 GPR06=002c99b8 GPR07=00da9598
[KRN] GPR08=012ecc00 GPR09=0000004e GPR10=00000120 GPR11=00da50c0
[KRN] GPR12=48004022 GPR13=00000000 GPR14=00000000 GPR15=000d0000
[KRN] GPR16=00f5fed0 GPR17=00000001 GPR18=00f60000 GPR19=011cf4bc
[KRN] GPR20=00000002 GPR21=00000000 GPR22=00000000 GPR23=00f60000
[KRN] GPR24=00db0000 GPR25=00da5120 GPR26=00000000 GPR27=8042ac64
[KRN] GPR28=00da50c0 GPR29=00f19cd0 GPR30=00000013 GPR31=00d87620
[KRN] Hash1 dump:
[KRN] 80000010.04000012 800007a0.f800f03a 80000400.8000803a
[KRN] 80000420.8800803a 00000000.00000000 00000000.00000000
[KRN] Hash2 dump:
[KRN] 8000000f.03fff012 800007bf.07ff0010 8000040f.83ff703a
[KRN] 00000000.00000000 00000000.00000000 00000000.00000000
[KRN] Instruction dump:
[KRN] 00ed4428: 88040000
[KRN] 00ed442c: 7c604851
[KRN] 00ed4430: 4c820020
[KRN] 00ed4434: 2f890000
[KRN] 00ed4438: 4d9e0020
[KRN] 00ed443c: 39000000
[KRN] 00ed4440: 7d674214
[KRN] 00ed4444: 7d444214
[KRN] Backtrace:
[KRN] 00e80980: byte 40 in func MUIMaster_MUI_GetClass, module
[KRN] 00e82070: byte 56 in func MUIMaster_MUI_NewObjectA, module
[KRN] 011049d0: byte 176 in func MUI_NewObject, module NList.mcc
[KRN] 010d9a50: byte 632 in func mNL_New, module NList.mcc
[KRN] 010db7e0: byte 880 in func _Dispatcher, module NList.mcc
[KRN] 00e941cc: byte 28 in func metaDispatcher, module muimaster.library
[KRN] 010d35c0: byte 48 in func DoSuperMethodA, module Mailtext.mcc
[KRN] 010d291c: byte 80 in func Mailtext__OM_NEW, module Mailtext.mcc
[KRN] 010ceac0: byte 204 in func Mailtext_Dispatcher, module Mailtext.mcc
[KRN] 00e941cc: byte 28 in func metaDispatcher, module muimaster.library
[KRN] ff8af35c: byte 40 in func CoerceMethodA, module intuition.library
[KRN] ff8842dc: byte 164 in func Intuition_NewObjectA, module intuition.library
[KRN] 00e82098: byte 96 in func MUIMaster_MUI_NewObjectA, module
[KRN] 0110b27c: byte 176 in func MUI_NewObject, module Mailtext.mcp
[KRN] 01108088: byte 952 in func MailtextP__OM_NEW, module Mailtext.mcp
[KRN] 01105b68: byte 180 in func MailtextP_Dispatcher, module Mailtext.mcp
[KRN] 00e941cc: byte 28 in func metaDispatcher, module muimaster.library
[KRN] ff8af35c: byte 40 in func CoerceMethodA, module intuition.library
[KRN] ff8842dc: byte 164 in func Intuition_NewObjectA, module
[KRN] 00e01110: byte 2476 in func init_gui, module Zune
[KRN] 00e016f8: byte 276 in func main, module Zune
[KRN] 00dffcb4: byte 452 in module Zune
[KRN] ff8c2a38: byte 36 in func DosEntry, module dos.library
[KRN] ff8c5274: byte 13092 in module dos.library
[KRN] **UNHANDLED EXCEPTION** stopping here…

The next release will get rid of the “stopping here…” message. Instead of halting whole aros, the failing task will be moved away, a popup message will appear, and AROS will continute to work. Stay tuned…

New efika iso

The last ISO you got was a bit annoying. There were almost forty modules to load by OF. It took long. Moreover, putting these files on FAT-formatted USB stick failed, since OF was unable to find some of the files.

I made few changes to the bootstrap code and AROS itself. AROS sets up interrupts in proper way. It should not lock anymore, as it happened before. The USB mass storage has been fixed a bit and should work a bit better now. Regarding the bootstrap code, following changes have been made:

  • os_image does not need the boot-device setting anymore. Boot it from any place and it will work as expected.
  • os_image honors the command line argument passed from OF. Now, if both menu.lst and OF command line contain parameters for kernel, they will be joined together.
  • os_image supports packages. No need to load 40 boot files through OF anymore. There will be few packages: generic-ppc, efika, usb and few other files to load. It means faster boot time and less risk of OF issues 😉
  • os_image does not support timeout option anymore. If there are more kernel configurations, it will stop and wait for an input.

Although timeout is gone, os_image on this cd will boot aros without waiting. I have removed the second boot option, which was not used anymore. How to boot? Put the CD into drive and type:

boot cd os_image

whereas “cd” corresponds to the boot device you use. You may find this iso here.

Remember me?

Last few weeks I satvery far away from all my computers. The reason, you ask? We have changed our flat against a bigger one, so that all of us have more room for work, amusement and a living. Moving affects thousands of resources, costs money and affects health. I bet I have more gray hair now than a month ago 😉

I have applied for the mass storage bouty recently and I have been working on it again during last few days. This USB class adds an exec-style device to the system, named usbmss.device. It allows programs and filesystems not aware of AROS’ USB stack to talk with the MSS class devices attached to the computer. Currently, it’s able to forward many exec-style commands to and from the USB device. It does not report medium change and lies about media type (it says that evertything is of type DG_DIRECT_ACCESS). Once this issues will be addressed, the device interface will be completed. Then, the USB Mass Storage will call expansion’s AddBootNode function and I will hopefully boot AROS from USB stick.

Then, the bounty might be considered complete. 😉

PS. On the screenshot below, the freshly created FAT32 partition on virtual MSS device on QEmu.

USB Mass Storage


Since I have signed for the USB Mass Storage bounty, I started to toy with the USB manuals, AROS’ USB stack and Efika. During my coding evening it suddenly turned out, that I’ve lost the bits and pieces of AROS USB code which were responsible for Bulk transfers. Funny. They were there a very long time ago, among my sources, now they were gone.

Whatever. I’ve added the bulk transfer support to USB stack implemented it in both OHCI and UHCI driver (the support for UHCI will follow shortly) and wrote the first bits and pieces of mass storage class. Here’s the result:

[USB] USB::NewDevice()
[USB] Trying external class “hid.hidd”
[USB] Trying external class “storage.hidd”
[MSS] MatchCLID(0x8ed55, 0x89d74)
[MSS] UDCLASS_IN_INTERFACE OK. Checking interface 0
[MSS] iface 0 @ 0x89d7d class 8 subclass 6 protocol 80
[MSS] Interface may be handled by Mass Storage Class
[MSS] Lucky you. The device supports Bulk Only transport
[MSS] Protocol used: SCSI complete
[MSS] Pick me! Pick me! Pick me! I can handle it!
[USB] clid = 0xff93ede4
[MSS] Storage::New()
[USB] USBDevice::New()
[USBDevice::New] Device 0165:1307 00/00/00 at address 0008c314:02
[USBDevice::New] Default LangID=0904
[USBDevice::New] iProduct = “USB Flash Disk”
[USBDevice::New] iManufacturer = “General”
[USBDevice::New] iSerial = “4b25950686c791”
[MSS] GetMaxLUN returns 0
[MSS] Interface is supposed to have 3 endpoints
[MSS] OUT endpoint found
[MSS] IN endpoint found
[MSS] DirectSCSI -> (43425355,00000001,00000008,00,80,0a)
[MSS] DirectSCSI <- (53425355,00000001,00000000,00)
[MSS] Detected capacity: 964MB
[MSS] DirectSCSI -> (43425355,00000002,00000400,00,80,0a)
[MSS] DirectSCSI <- (53425355,00000002,00000000,00)
[MSS] 0000: eb 3c 90 4d 53 44 4f 53 35 2e 30 00 02 20 01 00 .<.MSDOS5.0.. ..
[MSS] 0010: 02 00 02 00 00 f8 f1 00 3f 00 ff 00 00 00 00 00 ……..?…….
[MSS] 0020: 00 20 1e 00 00 00 29 b6 3b 10 80 4e 4f 20 4e 41 . ….).;..NO NA
[MSS] 0030: 4d 45 20 20 20 20 46 41 54 31 36 20 20 20 33 c9 ME FAT16 3.
[MSS] 0040: 8e d1 bc f0 7b 8e d9 b8 00 20 8e c0 fc bd 00 7c ….{…. …..|
[MSS] 0050: 38 4e 24 7d 24 8b c1 99 e8 3c 01 72 1c 83 eb 3a 8N$}$….<.r...:
[MSS] 0060: 66 a1 1c 7c 26 66 3b 07 26 8a 57 fc 75 06 80 ca f..|&f;.&.W.u…
[MSS] 0070: 02 88 56 02 80 c3 10 73 eb 33 c9 8a 46 10 98 f7 ..V….s.3..F…
[MSS] 0080: 66 16 03 46 1c 13 56 1e 03 46 0e 13 d1 8b 76 11 f..F..V..F….v.
[MSS] 0090: 60 89 46 fc 89 56 fe b8 20 00 f7 e6 8b 5e 0b 03 `.F..V.. ….^..
[MSS] 00a0: c3 48 f7 f3 01 46 fc 11 4e fe 61 bf 00 00 e8 e6 .H…F..N.a…..
[MSS] 00b0: 00 72 39 26 38 2d 74 17 60 b1 0b be a1 7d f3 a6 .r9&8-t.`….}..
[MSS] 00c0: 61 74 32 4e 74 09 83 c7 20 3b fb 72 e6 eb dc a0 at2Nt… ;.r….
[MSS] 00d0: fb 7d b4 7d 8b f0 ac 98 40 74 0c 48 74 13 b4 0e .}.}….@t.Ht…
[MSS] 00e0: bb 07 00 cd 10 eb ef a0 fd 7d eb e6 a0 fc 7d eb ………}….}.
[MSS] 00f0: e1 cd 16 cd 19 26 8b 55 1a 52 b0 01 bb 00 00 e8 …..&.U.R……
[MSS] 0100: 3b 00 72 e8 5b 8a 56 24 be 0b 7c 8b fc c7 46 f0 ;.r.[.V$..|…F.
[MSS] 0110: 3d 7d c7 46 f4 29 7d 8c d9 89 4e f2 89 4e f6 c6 =}.F.)}…N..N..
[MSS] 0120: 06 96 7d cb ea 03 00 00 20 0f b6 c8 66 8b 46 f8 ..}….. …f.F.
[MSS] 0130: 66 03 46 1c 66 8b d0 66 c1 ea 10 eb 5e 0f b6 c8 f.F.f..f….^…
[MSS] 0140: 4a 4a 8a 46 0d 32 e4 f7 e2 03 46 fc 13 56 fe eb JJ.F.2….F..V..
[MSS] 0150: 4a 52 50 06 53 6a 01 6a 10 91 8b 46 18 96 92 33 JRP.Sj.j…F…3
[MSS] 0160: d2 f7 f6 91 f7 f6 42 87 ca f7 76 1a 8a f2 8a e8 ……B…v…..
[MSS] 0170: c0 cc 02 0a cc b8 01 02 80 7e 02 0e 75 04 b4 42 ………~..u..B
[MSS] 0180: 8b f4 8a 56 24 cd 13 61 61 72 0b 40 75 01 42 03 …V$..aar.@u.B.
[MSS] 0190: 5e 0b 49 75 06 f8 c3 41 bb 00 00 60 66 6a 00 eb ^.Iu…A…`fj..
[MSS] 01a0: b0 4e 54 4c 44 52 20 20 20 20 20 20 0d 0a 4e 54 .NTLDR ..NT
[MSS] 01b0: 4c 44 52 20 69 73 20 6d 69 73 73 69 6e 67 ff 0d LDR is missing..
[MSS] 01c0: 0a 44 69 73 6b 20 65 72 72 6f 72 ff 0d 0a 50 72 .Disk error…Pr
[MSS] 01d0: 65 73 73 20 61 6e 79 20 6b 65 79 20 74 6f 20 72 ess any key to r
[MSS] 01e0: 65 73 74 61 72 74 0d 0a 00 00 00 00 00 00 00 00 estart……….
[MSS] 01f0: 00 00 00 00 00 00 00 00 00 00 00 ac bf cc 55 aa …………..U.

With a bit of luck mass storage bounty will be completed next week 🙂