English Amiga Board


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

 
 
Thread Tools
Old 21 March 2019, 15:15   #1
alkis
Registered User
 
Join Date: Dec 2010
Location: Athens/Greece
Age: 53
Posts: 719
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, 83 views)
alkis is offline  
Old 21 March 2019, 16:34   #2
Dan
Registered User
 
Dan's Avatar
 
Join Date: Nov 2004
Location: Germany
Posts: 629
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 16:47.
Dan is offline  
Old 21 March 2019, 18:28   #3
alkis
Registered User
 
Join Date: Dec 2010
Location: Athens/Greece
Age: 53
Posts: 719
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, 21:33   #4
AMIGASYSTEM
Registered User
 
AMIGASYSTEM's Avatar
 
Join Date: Aug 2014
Location: Brindisi (Italy)
Age: 70
Posts: 8,248
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, 00:20   #5
alkis
Registered User
 
Join Date: Dec 2010
Location: Athens/Greece
Age: 53
Posts: 719
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, 06:09   #6
McTrinsic
Registered User
 
Join Date: Feb 2014
Location: Germany
Posts: 527
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, 11:42   #7
alkis
Registered User
 
Join Date: Dec 2010
Location: Athens/Greece
Age: 53
Posts: 719
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, 13:04   #8
McTrinsic
Registered User
 
Join Date: Feb 2014
Location: Germany
Posts: 527
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
loadwb -debug TroyWilkins Amiga scene 24 14 September 2020 19:06
3.5.0 crashes on me NLS support.WinUAE 7 22 June 2017 15:50
LoadWB - Issue DamienD support.Other 21 19 April 2016 10:01
Wb 3.1 LoadWB freeze Bamiga2002 support.Apps 0 10 January 2012 12:06
WinUAE 1.2 Crashes Anubis support.WinUAE 6 27 February 2006 19: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 05:26.

Top

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