English Amiga Board


Go Back   English Amiga Board > Coders > Coders. Language > Coders. C/C++

 
 
Thread Tools
Old 21 March 2019, 16:15   #1
alkis
Registered User

 
Join Date: Dec 2010
Location: Athens/Greece
Age: 48
Posts: 498
loadwb replacement crashes on OS<2.0

Hello all,

I got this http://aminet.net/package/util/sys/GoWB and it works on emulated a500+, a1200 but not on A1000/A500.

Anyone can spot any issue(s)?

Code:
#include <proto/exec.h>
#include <proto/dos.h>

#ifndef NDEBUG
void kprintf(const char *fmt, ...);
#define DBUG(...) kprintf(__VA_ARGS__)
#else
#define DBUG(...)
#endif


struct wbgo {
  struct Message wbm;
  struct Locklist *locks;
  long debug;
};


int main(void)
{
  struct ExecBase *SysBase = (*((struct ExecBase **) 4));
  /* open DOS */
  struct Library *DOSBase=OldOpenLibrary((STRPTR) "dos.library");

  /* find the Workbench in ROM */
  struct Resident *wbres=FindResident((STRPTR) "workbench.task");
  DBUG("wbres=%lx\n", wbres);

  /* my process */
  struct Process *pr=(struct Process*)FindTask(0);

  /* my CLI */
  struct CommandLineInterface *mycli=(struct CommandLineInterface*)(BADDR(pr->pr_CLI));

  /* CLI-Output (must be closed for EndCLI */
  BPTR cfh=mycli->cli_CurrentInput;
  BPTR sfh=mycli->cli_StandardInput;
  struct FileHandle *mfh=(struct FileHandle*)BADDR(sfh);

  /* start workbench task */
  struct Port *newproc=(struct Port *) CreateProc((STRPTR) "workbench.task",0,((long)wbres+0x2a)>>2,5000);

  /* my very own process msg-port */
  struct Port *myport=(struct Port *) &pr->pr_MsgPort;

  /* startup message */
  struct wbgo wbmsg;

  /* initialize startup message */
  wbmsg.wbm.mn_ReplyPort= (struct  MsgPort *)myport;

  /* not used, for additional information only */
  wbmsg.locks=0;
  wbmsg.debug=1;

  /* send Msg and wait for reply */
  PutMsg((struct MsgPort *)newproc,(struct Message *)&wbmsg);
  WaitPort((struct MsgPort *)myport);
  GetMsg((struct MsgPort *)myport);

  DBUG("Got reply...\n");

    
  // Endcli

  // close Input() and Output(), Batch-file 
  mfh->fh_Pos=mfh->fh_End;
  mfh->fh_End=0;
  if(sfh!=cfh) {
    mycli->cli_CurrentInput=sfh;
    Close(cfh);
  }

  // cancel CLI
  mycli->cli_Background=-1;
  Exit(0);
    
  return 0;
}
For your convenience, attached a gcc6 compatible makefile project.

Alternatively, any loadwb replacement that works in all amigas?

Thanks
Attached Files
File Type: zip gowb.zip (5.4 KB, 26 views)
alkis is offline  
Old 21 March 2019, 17:34   #2
Dan
Registered User

Dan's Avatar
 
Join Date: Nov 2004
Location: Germany
Posts: 449
In the past i have made a working adf (in a try to make a smallest bootable adf) with GoWB.

I guess that the Crash is happening because of the missing library.

read here:
http://eab.abime.net/showpost.php?p=1140014&postcount=4

Last edited by Dan; 21 March 2019 at 17:47.
Dan is offline  
Old 21 March 2019, 19:28   #3
alkis
Registered User

 
Join Date: Dec 2010
Location: Athens/Greece
Age: 48
Posts: 498
Indeed, having icon.library in libs: allows GoWB to work in a500/a1000.

Kind of defeats the purpose to have a disk freely distributable though if you are gonna include Commodore's code.

Thanks though!
alkis is offline  
Old 21 March 2019, 22:33   #4
AMIGASYSTEM
Registered User
AMIGASYSTEM's Avatar
 
Join Date: Aug 2014
Location: Brindisi (Italy)
Posts: 5,236
There is also a icon.library even contains a few instructions (LoadWB, EndCli) for executing it from the startup-sequence, 1.x, 2.x, 3.x compatible, you can not replace it with any other icon.library.


http://aminet.net/package/disk/misc/BootWB1x
AMIGASYSTEM is offline  
Old 22 March 2019, 01:20   #5
alkis
Registered User

 
Join Date: Dec 2010
Location: Athens/Greece
Age: 48
Posts: 498
Quote:
Originally Posted by AMIGASYSTEM View Post
There is also a icon.library even contains a few instructions (LoadWB, EndCli) for executing it from the startup-sequence, 1.x, 2.x, 3.x compatible, you can not replace it with any other icon.library.


http://aminet.net/package/disk/misc/BootWB1x
Nice. Never seen the concept of library working as an executable as well. Neat.
alkis is offline  
Old 22 March 2019, 07:09   #6
McTrinsic
Registered User

 
Join Date: Feb 2014
Location: Germany
Posts: 471
I guess the package contains some more files than icon.lib. The icon lib isn’t executable afair.
McTrinsic is offline  
Old 22 March 2019, 12:42   #7
alkis
Registered User

 
Join Date: Dec 2010
Location: Athens/Greece
Age: 48
Posts: 498
Quote:
Originally Posted by McTrinsic View Post
I guess the package contains some more files than icon.lib. The icon lib isn’t executable afair.
It is executable. You can do
icon.library LOADWB
icon.library DELAY
icon.library ENDCLI
alkis is offline  
Old 22 March 2019, 14:04   #8
McTrinsic
Registered User

 
Join Date: Feb 2014
Location: Germany
Posts: 471
Great, I learned something new today!

Thanks a lot.
McTrinsic is offline  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
3.5.0 crashes on me NLS support.WinUAE 7 22 June 2017 16:50
loadwb -debug TroyWilkins Amiga scene 22 19 March 2017 12:08
LoadWB - Issue DamienD support.Other 21 19 April 2016 11:01
Wb 3.1 LoadWB freeze Bamiga2002 support.Apps 0 10 January 2012 13:06
WinUAE 1.2 Crashes Anubis support.WinUAE 6 27 February 2006 20:05

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 21:38.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2019, vBulletin Solutions Inc.
Page generated in 0.07052 seconds with 16 queries