Login
Username:

Password:

Remember me



Lost Password?

Register now!

Sections

Who's Online
75 user(s) are online (58 user(s) are browsing Forums)

Members: 1
Guests: 74

Raziel, more...

Support us!

Headlines




(1) 2 »


Amiga programming NOOB question
Just popping in
Joined:
2006/12/6 12:05
From Beverland
Posts: 151
I am trying to build the AHI source from aminet. "unfortunately" it is multiplatform so the source needs to be configured for amigaos4.
So I run the configure script to create the makefiles for the device and drivers but it fails on a missing component called SFDC.

Found SFDC master on aminet. It claims to "convert SFD files into something useful". It is created by the same programmer as the one who created AHI so this must be the component that I am looking for.

After config and make install it creates the following three files:
/SDK/local/C/sfdc
/SDK/POSIX/usr/local/bin/sfdc
/SDK/POSIX/usr/local/share/man/man1/sfdc.1

So I run the the configuration script of AHI again and SFDC is found. Configuration was successfull and the makefiles are now succesfully created.

But when I try to make AHI I get the following error:

SFDC --target=powerpc-unknown-amigaos --mode=gatestubs ../Include/SFD/ahi_lib.sfd --output gatestubs.c \
--gateprefix=gw --libprefix=_ --libarg=last --addvectors=device
T:gmake.sh.1843.WFIUPW[2]: SFDC: No such file or directory
gmake[1]: *** [gatestubs.c] Error 1


Apparently SFDC is not found. So nothing "useful" is created as promised. Upon inspection of the sfdc created in the SDK, sfdc is not a binary but some kind of perl script.
Anybody knows what I am doing wrong here?

   Report Go to top

Re: Amiga programming NOOB question
Just popping in
Joined:
2020/11/17 12:08
From Slough
Posts: 161
if SFDC is a perl script it won't just run, at least it will need to be +es protection bit and the first line will need to be running perl

   Report Go to top

Re: Amiga programming NOOB question
Quite a regular
Joined:
2007/2/27 10:47
From Gravity well
Posts: 728
@geennaam

I haven't used that program, but if the makefile has one or few places with it, place "perl" and the full path in front. Maybe also the full path to perl if needed.

   Report Go to top

Re: Amiga programming NOOB question
Just popping in
Joined:
2006/12/6 12:05
From Beverland
Posts: 151
@NinjaCyborg

Thanks. The first line had some unix path to perl in place. Replaced it with #!/SDK/Local/C/perl and now it runs.

Next issue is that perl throws me a script failure. But I will try this next week on AmigaOSFE with the latest SDK. See if this helps.

The Envy24HT driver seems to missing library_card.c and h.
It is supposed to be located in /Drivers/Common and is only needed for the amigaos4 driver.

Going to create dummies and see what happens.

   Report Go to top

Re: Amiga programming NOOB question
Just popping in
Joined:
2006/12/6 12:05
From Beverland
Posts: 151
@Thematic

Solved with correcting the path in the script self. Apparantly it wasn't fully configured for Amigaos4 or maybe it was expected to run with some cross compiler.

   Report Go to top

Re: Amiga programming NOOB question
Just can't stay away
Joined:
2009/5/1 18:57
From Czech Republic
Posts: 1282
@geennaam

Lyle Hazelwood has done some recent work on the OS4 AHI drivers. He might give you useful tips. Drop him a line: lylehaze at gmail.

_________________
The Rear Window blog

AmigaOne X5000 @ 2GHz / 4GB RAM / Radeon RX 560 / ESI Juli@ / AmigaOS 4.1 Final Edition
SAM440ep-flex @ 667MHz / 1GB RAM / Radeon 9250 / AmigaOS 4.1 Final Edition
   Report Go to top

Re: Amiga programming NOOB question
Just popping in
Joined:
2006/12/6 12:05
From Beverland
Posts: 151
@trixie

Thanks, I will need it.
Both Morphos and Aros use the available library.c and h. Why Amigaos4 ifdefs to the missing library_card instead is a mystery to me.

All I need is a AHI driver source for a "modern" chipset that can actually produce a working driver with the latest SDK to act as a template for my own driver. Because AHI driver development is not/poorly documented.

I read everywhere that the Envy24ht is the most stable driver. Hence this effort.

Found this thread with google:
https://os4coding.net/comment/2378
A guy called Hypex tried to compile the Emu10kx driver with help from the original coder but eventually gave up. Best quote in the thread: "I had to agree with Davy (Wentzler) in the end, that compiling an AHI driver is a bitch! "




   Report Go to top

Re: Amiga programming NOOB question
Just can't stay away
Joined:
2006/11/30 11:30
From Finland
Posts: 1800
@geennaam

Have you tried changing the reference library_card.c/.h references to library.c/.h? It's possible that the library_card files have been removed because they were no longer needed and the driver code just hasn't been updated.

   Report Go to top

Re: Amiga programming NOOB question
Home away from home
Joined:
2007/9/11 12:31
From Russia
Posts: 7018
@geennaam
Quote:

Why Amigaos4 ifdefs to the missing library_card instead is a mystery to me.


Don't expect that things will compile out of the box for aros/morphos/amigaos4/amigaos3 ever. Even if there can be some source code which pretends to, it still will not (many reasons: changed SDKs over time, different include hackish on the developer and public SDKs, native or cross-compiler usage, using of hardcoded paths in build scripts, usage of different make tools (anycygnix one, native one, POSIX one from the "sh" only and so on).


Quote:

Best quote in the thread: "I had to agree with Davy (Wentzler) in the end, that compiling an AHI driver is a bitch! "


Compiling everything on amigaos4 can be a bitch, the matter only your motivation and wish to have a final result. One may give up after few tries and stop at the beginning, another one will solve things one by one, day by day, week by week, and have something in end :)

And btw, it better to not use makefiles done by others, at beginning at least, as you can in end burn out to deal with them. Better to see what files it compiles, and then (for first) manually compile object by object, to solve real issues, and not makefile ones.

_________________
Join us to improve dopus5!
zerohero's mirror of os4/os3 crosscompiler suites
   Report Go to top

Re: Amiga programming NOOB question
Just popping in
Joined:
2006/12/6 12:05
From Beverland
Posts: 151
@kas1e

The unix path in the sfdc script raised the suspicion that AHI was build with a cross compiler anyways. So I am now creating the cross compiler environment using your blog post

   Report Go to top

Re: Amiga programming NOOB question
Just popping in
Joined:
2006/12/6 12:05
From Beverland
Posts: 151
@salass00

Good idea. That is worth a try

   Report Go to top

Re: Amiga programming NOOB question
Just popping in
Joined:
2006/12/6 12:05
From Beverland
Posts: 151
@kas1e

Problem is that the AHI makefiles create Os4 specific files with SFDC. So I have to run it at least once.

   Report Go to top

Re: Amiga programming NOOB question
Just popping in
Joined:
2020/11/17 12:08
From Slough
Posts: 161
@kas1e

What really really needs to happen, ahead of pretty much any new development of Amiga OS, is for common, stable universal toolchain to be established that means developers can share and collaborate and not have to worry about differing includes, libs, tools, and all that crap. It's by far the biggest barrier to entry for anyone wanting to come and have a go at doing Amiga stuff.

As a professional software development manager out in the real world, you cannot expect developers to be productive if they spend most of them time faffing with the tooling. Microsoft and Apple figured this out over 20 years go, which is why there's no longer a Borland or Metrowerks or anyone else providing the tooling for Windows and Mac/iOS.

The OS4 SDK was a huge step in the right direction, but it's not been maintained and now it's massively out of date again. I hope it's being updated properly, at the same time as the new OS3.2 SDK is being put together.

   Report Go to top

Re: Amiga programming NOOB question
Home away from home
Joined:
2007/9/11 12:31
From Russia
Posts: 7018
@NinjaCyborg
Quote:

It's by far the biggest barrier to entry for anyone wanting to come and have a go at doing Amiga stuff.


The biggest barrier its all those ideas on how to save an amigaos4 and what is need it :)

The OS4 SDK in the current form is more than enough for any native amigaos4 development if you do things from scratch. For real. Nothing else needs it.

All those play-games with new compilers, new versions of GCC and co, that all only for making some modern and fresh stuff to port. Yes, mostly _to port_. For plain, standard, native amigaos4 app there is really no big need for updating SDK.

Updating SDK will happen one day, but not expect it will give you anything which you didn't have now. It will just have updated SYSTEM includes, and GCC, and maybe some other tools (or maybe not). But it will not give you anything which will make you think that everything is as you want it to be.

You still need to download manually stuff, you still need to understand how it all structured, you still need to spend time on all sorts of stuff. And, by the way, the same happens everywhere, I know it, and in windows and in the Linux world.

It's just once you start complaining, you can't stop and will try to find anything which you may think is bad, while in reality if you want to do something, you do it.

New SDK anyway planned, but as I say didn't expect it to be radically different from what is now, just updated system includes, libs and GCC. And if you want updated GCC right now, you just fiddling with adtools, or just not, and use old SDK with no problems too.

_________________
Join us to improve dopus5!
zerohero's mirror of os4/os3 crosscompiler suites
   Report Go to top

Re: Amiga programming NOOB question
Just can't stay away
Joined:
2009/5/1 18:57
From Czech Republic
Posts: 1282
@NinjaCyborg

Quote:
What really really needs to happen, ahead of pretty much any new development of Amiga OS, is for common, stable universal toolchain to be established that means developers can share and collaborate and not have to worry about differing includes, libs, tools, and all that crap.

Agreed. An updated SDK integrating a recent and well-tested build of GCC, plus all the related tools and documentation, would be a step in the right direction. Not everyone is fond of fishing things out of the adtools repository and other places.

_________________
The Rear Window blog

AmigaOne X5000 @ 2GHz / 4GB RAM / Radeon RX 560 / ESI Juli@ / AmigaOS 4.1 Final Edition
SAM440ep-flex @ 667MHz / 1GB RAM / Radeon 9250 / AmigaOS 4.1 Final Edition
   Report Go to top

Re: Amiga programming NOOB question
Just popping in
Joined:
2020/11/17 12:08
From Slough
Posts: 161
@kas1e

it's that 'just fiddling with adtools' that is not as small as issue as you make out. As bare minimum, OS4 SDK needs newer GCC, ideally 9 or 10, latest clib2/newlib updates included, and setup scripts not just for amiga native toolchain but linux cross compiler too.

Linux might have similar issues, but Windows and Mac certainly do not - as I said, Microsoft and Apple learned that lesson a long long time ago.

   Report Go to top

Re: Amiga programming NOOB question
Just popping in
Joined:
2006/12/6 12:05
From Beverland
Posts: 151
@kas1e

Quote:
And btw, it better to not use makefiles done by others, at beginning at least, as you can in end burn out to deal with them. Better to see what files it compiles, and then (for first) manually compile object by object, to solve real issues, and not makefile ones.


I spend a day creating a cross compiler environment. First tried several times with msys2. But that didn't work out. Got it working with ADTOOLS on cygwin following your step by step guide here: https://www.amigans.net/modules/xforum/viewtopic.php?post_id=116486

As expected, the SFDC script runs fine in this environment. Unfortunately it produced unusable files that gave a lot of compiler errors.

So I followed your advice and tried to compile the Envy24HT source files one by one.

But it almost feels like the sources are sabotaged.
Envy24HT.c includes pci_wrapper.h and proto/expansions.h
proto/expansions.h includes expansion/pci.h.
In pci.h, we can for example find:

enum enPCIConfigSpace{
PCI_VENDOR_ID = 0x00,
PCI_DEVICE_ID = 0x02,
.. and so on
};

But pci_wrapper.h continues with an #undef PCI_DEVICE_ID
and #define PCI_DEVICE_ID 2

Not only is this useless considering the enum in pci.h. The compiler also punishes me with a "error: expected identifier before numeric constant".

So I have a lot of cleanup to do. Not only fix all compiler errors, but also remove the Morphos and Aros code until I get a clean AmigaOS4 AHI driver framework. (hint: Coffee prices will go up in the coming weeks )

It feels like it will only compile out of the box on the target which was last in line to port the driver to.

   Report Go to top

Re: Amiga programming NOOB question
Just popping in
Joined:
2006/12/6 12:05
From Beverland
Posts: 151
Another Noob question:
I am writing a amigaos4.1 library and want to save streamed data to a file.
Therefore I've created a child process for saving inside an amigaos4.1 library with:
// Create child proccess from within a funcion in the main process
   
... = libBase->IDOS->CreateNewProcTags(NP_Entry, (uint32)NameOfChildProcessFunction),
                                          ....
                                          
END_TAG);


There is little documentation available but from what is available I understand that each (child) process must have it's own interface to external libraries.
So how does this work? Is it as simple as just opening a second Interface and use this in child process because the library is already opened in the main process?:

/* The ROMTAG Init Function */
STATIC struct myBase *libInit(struct Library *LibraryBaseAPTR SegListstruct Interface *exec)
{
   
struct myBase *libBase = (struct myBase *)LibraryBase;
   
struct ExecIFace *IExec UNUSED = (struct ExecIFace *)exec;
   
// Interface for main process
   
libBase->IExec = (struct ExecIFace *)exec;
   
// Interface for child process
   
libBase->ChildIExec = (struct ExecIFace *)exec;
   ...
}



Can I pass on the same lib base to the child process and in the same way what is done for the functions in the main process?
// libBase pointer in main process
void FunctionInMainProcess(struct myIFace *Self )
{
   
struct myBase *libBase = (struct myBase *)Self->LibBase;
   
libBase->IExec->DebugPrintf("This is the standard method");
   ...
}

// libBase pointer in child process
void FunctionInChildProcess(struct myIFace *Self )
{
   
struct myBase *libBase = (struct myBase *)Self->LibBase;
   
libBase->ChildIExec->DebugPrintf("This is legal, if not please help?n");
   ...
}


Up to now, nothing has been easy in amigaland. Little documentation so a very steep learning curve. But I am not about to give up yet .

   Report Go to top

Re: Amiga programming NOOB question
Just can't stay away
Joined:
2009/5/1 18:57
From Czech Republic
Posts: 1282
@geennaam

I can't answer all of your questions but this is how I create a child process in one of my programs:

struct Process *process;

process IDOS->CreateNewProcTags(
                
NP_Name"Project",
                
NP_Entryproject_func,
                
NP_ChildTRUE,
                
TAG_END);


Right after creating the child process I send a startup message to the child's message port (get the pointer from the Project structure: &process->pr_MsgPort), the reply port being the main program's port. At the beginning of project_func() the child process waits for the startup message to arrive at its port, while the main process waits for the reply at the main port. Neither continues before all messages/replies have been duly received.

If I want to pass data between the main process and the child, I use a global data structure that has a struct Message at the very beginning. This way I can send the data as part of the startup message, ready for the child to pick up:

struct startupMsg
{
   
struct Message msg;
   
uint32 sizeOfMyShoes;
   
STRPTR nameOfMyDog;
   
BOOL   doIReallyHaveADog;
   
APTR   anyOtherData;
};


Hope this helps a little.

_________________
The Rear Window blog

AmigaOne X5000 @ 2GHz / 4GB RAM / Radeon RX 560 / ESI Juli@ / AmigaOS 4.1 Final Edition
SAM440ep-flex @ 667MHz / 1GB RAM / Radeon 9250 / AmigaOS 4.1 Final Edition
   Report Go to top

Re: Amiga programming NOOB question
Just popping in
Joined:
2006/12/6 12:05
From Beverland
Posts: 151
@trixie

The problem with libraries is that there is no startup code to create global variables for interfaces and variables like IDOS or DosBase. It is supposed to be good practice to store this in the library base structure. And so I did. This is why you see libBase->IExec in my code.

This structure is passed on to every "method" (my Library interface functions). But a child process is not an interface function. It cannot be called by the program which opens my library. So the library base structure with the external library interfaces like IExec is not passed on to the process.

I did a dirty trick by creating an addition global libBase called ProcLibBase and pointed it to the libBase of the main process inside the my library interface function that creates the child process. So now I have a local libBase and a global ProcLibBase. Because it is global, I can now call library funtions in the child process.

I noticed that you use the Tag NP_Child. According to this site (https://os4coding.net/forum/sharing-interfaces-your-children), this mean that both processes share the same context. And that it is reasonable safe to share the same external library interfaces like IDOS.

I only need to signal the process that it is now ok to start. The process will signal the main process when done. So I use signals instead of the message port.
So the signals are exchanged through the global ProcLibBase and this works. Don't know if i get a slap in my face by someone.
Still open for the proper implementation



Edited by geennaam on 2021/1/18 6:49:42
   Report Go to top


(1) 2 »



[Advanced Search]



Powered by XOOPS 2.0 © 2001-2016 The XOOPS Project