Is it Possable To Run Darwin/x86 On Joggler

General discussion relating to the O2 Joggler, from the default O2 setup, to alternative operating systems and applications.
verg0
Posts: 102
Joined: Tue Jul 19, 2011 9:37 am

Is it Possable To Run Darwin/x86 On Joggler

Post by verg0 »

Would it be possable to Port apple iOS on the Joggler?


http://tgwbd.org/darwin/boot.html
User avatar
Mevi
Posts: 774
Joined: Tue Oct 25, 2011 4:39 pm

Re: Is it Possable To Run Darwin/x86 On Joggler

Post by Mevi »

Do you mean iOS or OSX?

iOS - not a chance.
OSX - some chance as there's a big community in the Hackintosh scene. I got OSX Tiger 10.4 working on a C2D laptop for a while. The drivers will be a PITA.
I've Got The Moves Like Joggler

Windows XP Professional SP3 plus Tablet PC for O2 Joggler
http://www.jogglerwiki.com/forum/viewto ... ?f=2&t=305

How to build your own Windows XP for the Joggler
http://www.jogglerwiki.com/wiki/WindowsXP
verg0
Posts: 102
Joined: Tue Jul 19, 2011 9:37 am

Re: Is it Possable To Run Darwin/x86 On Joggler

Post by verg0 »

Yeah sorry OSX, see what you mean with the drivers, if we cant even get all the windows ones sorted, this was probly a silly question :oops: lol
User avatar
roobarb!
Posts: 1772
Joined: Sat Mar 05, 2011 1:30 pm
Location: Salford, UK
Contact:

Re: Is it Possable To Run Darwin/x86 On Joggler

Post by roobarb! »

verg0 wrote:Yeah sorry OSX
Possible, yes! Usable.. I doubt it. You'd be stuck on v10.4 (Tiger) or maybe v10.5 (Leopard), but even then the user experience would be awful. Mac OS X has not been designed with resolutions lower than 1024x768 in mind for a long time now.
BirdsLikeWires - Get fresh builds of Debian Bullseye, Bookworm, and Trixie for OpenFrame with the latest 5.10, 6.1, and 6.12 kernels! 8-)
User avatar
mickchip
Posts: 408
Joined: Thu Apr 14, 2011 7:06 am
Location: Handforth, Cheshire, UK

Re: Is it Possable To Run Darwin/x86 On Joggler

Post by mickchip »

I have OSX Leopard running on a Samsung Q1 Ultra 600mhz and it's quite usable, that was a while ago too
Take a look.

http://www.insanelymac.com/forum/index. ... h_id=53932
The GMA 500 could be the problem.
Jogglermaniac
danfoshizzle
Posts: 1271
Joined: Sun May 29, 2011 2:08 am
Location: somewhere near Rochester castle.

Re: Is it Possable To Run Darwin/x86 On Joggler

Post by danfoshizzle »

I think it would run osx pretty well, just with the eye candy turned down,


Who's gonna start work on it! Lol
Fullscreen squeezeplay windows, server 2003, foshiz mini v1 and v2, (and a few broken builds) :P so far.....
more to come!!

Jogglers " Obi Wan" according to Pete_c :D
User avatar
Mevi
Posts: 774
Joined: Tue Oct 25, 2011 4:39 pm

Re: Is it Possable To Run Darwin/x86 On Joggler

Post by Mevi »

I've got an install disk for OSX86 Tiger. When I get a moment, I'll see what happens. Problem is that the hacked Darwin bootloader emulates Apple's EFI for BIOS machines.

It'll be messy.

AND... I want to get XPe working first. :)
I've Got The Moves Like Joggler

Windows XP Professional SP3 plus Tablet PC for O2 Joggler
http://www.jogglerwiki.com/forum/viewto ... ?f=2&t=305

How to build your own Windows XP for the Joggler
http://www.jogglerwiki.com/wiki/WindowsXP
User avatar
Mevi
Posts: 774
Joined: Tue Oct 25, 2011 4:39 pm

Re: Is it Possable To Run Darwin/x86 On Joggler

Post by Mevi »

I've seen OSX running on a piss poor spec PPC iMac... Driver issues aside, I think it'll run on the Joggler spec.

"we choose to go to the moon, not because it is easy, but because it is hard"
I've Got The Moves Like Joggler

Windows XP Professional SP3 plus Tablet PC for O2 Joggler
http://www.jogglerwiki.com/forum/viewto ... ?f=2&t=305

How to build your own Windows XP for the Joggler
http://www.jogglerwiki.com/wiki/WindowsXP
danfoshizzle
Posts: 1271
Joined: Sun May 29, 2011 2:08 am
Location: somewhere near Rochester castle.

Re: Is it Possable To Run Darwin/x86 On Joggler

Post by danfoshizzle »

Also have a disk somewhere for 10.4 will have a bash, it runs on netbooks so we have a good chance!
Fullscreen squeezeplay windows, server 2003, foshiz mini v1 and v2, (and a few broken builds) :P so far.....
more to come!!

Jogglers " Obi Wan" according to Pete_c :D
User avatar
Mevi
Posts: 774
Joined: Tue Oct 25, 2011 4:39 pm

Re: Is it Possable To Run Darwin/x86 On Joggler

Post by Mevi »

exactly. I'm sure someones managed to get it running on a Poulsbo chipset.
I've Got The Moves Like Joggler

Windows XP Professional SP3 plus Tablet PC for O2 Joggler
http://www.jogglerwiki.com/forum/viewto ... ?f=2&t=305

How to build your own Windows XP for the Joggler
http://www.jogglerwiki.com/wiki/WindowsXP
danfoshizzle
Posts: 1271
Joined: Sun May 29, 2011 2:08 am
Location: somewhere near Rochester castle.

Re: Is it Possable To Run Darwin/x86 On Joggler

Post by danfoshizzle »

Not sure, would be worth fonding devices with this chipset and seeing if they run it
Fullscreen squeezeplay windows, server 2003, foshiz mini v1 and v2, (and a few broken builds) :P so far.....
more to come!!

Jogglers " Obi Wan" according to Pete_c :D
fidi
Posts: 4
Joined: Wed Dec 14, 2011 8:41 am

Re: Is it Possable To Run Darwin/x86 On Joggler

Post by fidi »

Hi all;
I messed around with this about a year ago. Then I moved (country) so had to stop as everything in boxes.

Managed to get to the point of pre booting kernel 10.0.0, but panics with no uptime, something like:
Panic...."pmap_enter: pv not in hash list ...." and a bunch of other stuff. Similar but different panic on legacy kernels/10.4.

I concluded that the EFI "environment" or memory parameters passed to the kernel were not set up correctly, and sort of gave up; as whilst I figured it could be made to work, needs someone who understands EFI/Grub, or Darwin kernel etc in depth!

In order to get this far, did some hacks to GRUB2 in order to get Darwin verbose console output on the joggler.
These were based around the GOP fix for Joggler documented elsewhere by Tony Hoyle.

Use of GRUB2 was the only solution (at that time) that I could get anywhere with, since I could not figure out how to boot Darwin via ReFit. (Had Refit on Joggler working, but...32/64bit or some other issue??) and of course the other Darwin boot approaches (aka Chameleon) at that time need BIOS not EFI, and I didn't figure out how to compile additional modules successfully to run on Joggler CPU, such as for chain loading, that might have enabled booting of Chameleon "boot0/1".

As for chipset, I think most if not all the hardware is supported/can be made to work (e.g.: GMA500), if can get kernel booted.

Probably will remember more about what I did now that am thinking of it!

Fidi.
danfoshizzle
Posts: 1271
Joined: Sun May 29, 2011 2:08 am
Location: somewhere near Rochester castle.

Re: Is it Possable To Run Darwin/x86 On Joggler

Post by danfoshizzle »

if you could sharee how you got that far maybe we could carry on your hard work?
Fullscreen squeezeplay windows, server 2003, foshiz mini v1 and v2, (and a few broken builds) :P so far.....
more to come!!

Jogglers " Obi Wan" according to Pete_c :D
fidi
Posts: 4
Joined: Wed Dec 14, 2011 8:41 am

Re: Is it Possable To Run Darwin/x86 On Joggler

Post by fidi »

So, my (Grub) development environment is on an Ubuntu desktop, and the (semi) working boot files on USB sticks, all now in storage. Only have a handful of files on the laptop. Hence, what I post here may not be the final stage I reached. But perhaps it can help:

For reference, info on building with patch for linux on Joggler is at http://jogglerhacks.blogspot.com/2010/0 ... ggler.html

Changes to Grub2 for Darwin #1:

Code: Select all

--- a/include/grub/i386/xnu.h
+++ b/include/grub/i386/xnu.h
@@ -45,6 +45,7 @@
   grub_xnu_ptr_t lfb_base;
 #define GRUB_XNU_VIDEO_SPLASH 1
 #define GRUB_XNU_VIDEO_TEXT_IN_VIDEO 2
+#define GRUB_XNU_VIDEO_JOGGLER 0x70
   grub_uint32_t lfb_mode;
   grub_uint32_t lfb_line_len;
   grub_uint32_t lfb_width;
Changes to Grub2 for Darwin #2:

Code: Select all

--- a/loader/i386/efi/xnu.c
+++ b/loader/i386/efi/xnu.c
@@ -19,15 +19,27 @@
 #include <grub/env.h>
 #include <grub/xnu.h>
 #include <grub/cpu/xnu.h>
+#include <grub/i386/xnu.h>
 #include <grub/efi/api.h>
 #include <grub/efi/efi.h>
 #include <grub/efi/uga_draw.h>
+#include <grub/efi/graphics_output.h>
 #include <grub/pci.h>
 #include <grub/misc.h>
 
 /* Setup video for xnu. Big parts are copied from linux.c. */
 
 static grub_efi_guid_t uga_draw_guid = GRUB_EFI_UGA_DRAW_GUID;
+static grub_efi_guid_t graphics_output_guid = GRUB_EFI_GOP_GUID;
+
+static grub_efi_gop_blt_t old_blt = 0;
+static struct grub_efi_gop *gop = 0;
+
+static grub_uint32_t ScreenWidth =0;
+static grub_uint32_t ScreenHeight =0;
+static grub_uint32_t ScreenDepth =0;
+static grub_uint32_t FrameBufferBase =0;
+static grub_uint32_t LineLength =0;
 
 #define RGB_MASK	0xffffff
 #define RGB_MAGIC	0x121314
@@ -139,40 +151,143 @@
   return found;
 }
 
+// Added Section...
+
+static grub_efi_status_t new_blt(struct grub_efi_gop *This,
+                                     void *BltBuffer,
+                                     grub_efi_uintn_t BltOperation,
+                                     grub_efi_uintn_t SourceX,
+                                     grub_efi_uintn_t SourceY,
+                                     grub_efi_uintn_t DestinationX,
+                                     grub_efi_uintn_t DestinationY,
+                                     grub_efi_uintn_t Width,
+                                     grub_efi_uintn_t Height,
+                                     grub_efi_uintn_t Delta)
+    {
+      grub_efi_uintn_t row,col,DeltaWidth;
+      grub_uint32_t *SourceBase, *DestinationBase;
+      This = This;
+
+      if(!FrameBufferBase)
+        return -1;
+
+      if(!Delta)
+        DeltaWidth = Width;
+      else
+        DeltaWidth = Delta/sizeof(grub_uint32_t);
+
+      switch(BltOperation)
+      {
+        case 0: //EfiBltVideoFill
+          DestinationBase = (grub_uint32_t*)FrameBufferBase + ScreenWidth*DestinationY + DestinationX;
+          for(row=0; row<Height; row++)
+          {
+            for(col=0; col<Width; col++)
+              DestinationBase[col]=*(grub_uint32_t*)BltBuffer;
+            DestinationBase+=ScreenWidth;
+          }
+          break;
+
+        case 1: // EfiBltVideoToBltBuffer
+          SourceBase = (grub_uint32_t*)FrameBufferBase + ScreenWidth*SourceY + SourceX;
+          DestinationBase = ((grub_uint32_t*)BltBuffer) + DeltaWidth*DestinationY + DestinationX;
+          for(row=0; row<Height; row++)
+          {
+            for(col=0; col<Width; col++)
+              DestinationBase[col]=SourceBase[col];
+            DestinationBase+=DeltaWidth;
+            SourceBase+=ScreenWidth;
+          }
+          break;
+
+        case 2: // EfiBltBufferToVideo
+          SourceBase = ((grub_uint32_t*)BltBuffer) + DeltaWidth*SourceY + SourceX;
+          DestinationBase = (grub_uint32_t*)FrameBufferBase + ScreenWidth*DestinationY + DestinationX;
+          for(row=0; row<Height; row++)
+          {
+            for(col=0; col<Width; col++)
+              DestinationBase[col]=SourceBase[col];
+            DestinationBase+=ScreenWidth;
+            SourceBase+=DeltaWidth;
+          }
+          break;
+
+        case 3: // EfiBltVideoToVideo
+          SourceBase = (grub_uint32_t*)FrameBufferBase + ScreenWidth*SourceY + SourceX;
+          DestinationBase = (grub_uint32_t*)FrameBufferBase + ScreenWidth*DestinationY + DestinationX;
+          for(row=0; row<Height; row++)
+          {
+            for(col=0; col<Width; col++)
+              DestinationBase[col]=SourceBase[col];
+            DestinationBase+=ScreenWidth;
+            SourceBase+=ScreenWidth;
+          }
+          break;
+        default:
+          return -1;
+      }
+
+      return 0;
+    }
+
 grub_err_t
 grub_xnu_set_video (struct grub_xnu_boot_params *params)
 {
-  grub_efi_uga_draw_protocol_t *c;
   grub_uint32_t width, height, depth, rate, pixel, fb_base, line_len;
   int ret;
 
-  c = grub_efi_locate_protocol (&uga_draw_guid, 0);
-  if (! c)
-    return grub_error (GRUB_ERR_IO, "couldn't find UGADraw");
-
-  if (efi_call_5 (c->get_mode, c, &width, &height, &depth, &rate))
-    return grub_error (GRUB_ERR_IO, "couldn't retrieve video mode");
-
-  grub_printf ("Video mode: %ux%u-%u@%u\n", width, height, depth, rate);
-
-  grub_efi_set_text_mode (0);
-  pixel = RGB_MAGIC;
-  efi_call_10 (c->blt, c, (struct grub_efi_uga_pixel *) &pixel,
-	       GRUB_EFI_UGA_VIDEO_FILL, 0, 0, 0, 0, 1, height, 0);
-  ret = find_framebuf (&fb_base, &line_len);
-  grub_efi_set_text_mode (1);
+  gop = grub_efi_locate_protocol (&graphics_output_guid, 0);
 
-  if (! ret)
-    return grub_error (GRUB_ERR_IO, "can\'t find frame buffer address");
+  if (gop) {
+      ScreenWidth = gop->mode->info->width;
+      ScreenHeight = gop->mode->info->height;
+      ScreenDepth = 32;
+      LineLength = 4 * gop->mode->info->pixels_per_scanline;
+      FrameBufferBase = gop->mode->fb_base;
+      old_blt = gop->blt;
+      gop->blt = new_blt;
+  	  }
+
+  if (gop) {
+     width = ScreenWidth;
+     height = ScreenHeight;
+     depth = ScreenDepth;
+     line_len = LineLength;
+     fb_base = FrameBufferBase;
+  } else
+   	 	 {
+	  	  grub_efi_uga_draw_protocol_t *c;
+
+	  	  c = grub_efi_locate_protocol (&uga_draw_guid, 0);
+	  	  if (! c)
+	  		  return grub_error (GRUB_ERR_IO, "couldn't find UGADraw");
+
+	  	  if (efi_call_5 (c->get_mode, c, &width, &height, &depth, &rate))
+	  		  return grub_error (GRUB_ERR_IO, "couldn't retrieve video mode");
+
+	  	  grub_efi_set_text_mode (0);
+	  	  pixel = RGB_MAGIC;
+	  	  efi_call_10 (c->blt, c, (struct grub_efi_uga_pixel *) &pixel,
+	       GRUB_EFI_UGA_VIDEO_FILL, 0, 0, 0, 0, 1, height, 0);
+	  	  ret = find_framebuf (&fb_base, &line_len);
+	  	  grub_efi_set_text_mode (1);
 
-  grub_printf ("Frame buffer base: 0x%x\n", fb_base);
-  grub_printf ("Video line length: %d\n", line_len);
+	  	  if (! ret)
+	  		  return grub_error (GRUB_ERR_IO, "can\'t find frame buffer address");
+   	 	 }
+
+  //grub_printf ("Video mode: %ux%u-%u@%u\n", width, height, depth, rate);
+  //grub_printf ("Frame buffer base: 0x%x\n", fb_base);
+  //grub_printf ("Video line length: %d\n", line_len);
 
   params->lfb_width = width;
   params->lfb_height = height;
   params->lfb_depth = depth;
   params->lfb_line_len = line_len;
-  params->lfb_mode = GRUB_XNU_VIDEO_TEXT_IN_VIDEO;
+  params->lfb_mode = GRUB_XNU_VIDEO_JOGGLER;
   params->lfb_base = fb_base;
+
+  // gop->blt = old_blt; 		/* Including this breaks xnu verbose if boot from menu ?? */
+
   return GRUB_ERR_NONE;
 }
Again, the above patches may in fact not be 100% correct, or complete. I remember that I made a couple of silly mistakes that took me a few days to resolve.

Possible version of grub.efi that has the verbose console working. Or perhaps does not ;)
grub.efi.zip
May be working version supporting verbose output.
(76.43 KiB) Downloaded 262 times
My Grub config:

Code: Select all

set default="0"
set timeout=5
menuentry "OSX" {
	set root=(hd0,1)
	insmod hfsplus
	xnu_kernel /mach_kernel
	xnu_mkext /Extra/Extensions.mkext
	xnu_mkext /System/Library/Caches/com.apple.kext.caches/Startup/Extensions.mkext	
}
Sorry it's all a bit vague :(
I would say, that I am not a programmer, so if I managed to get this far, I am sure others will have no trouble to get at least to the stage I did, and hopefully a lot further! And if we can get some sort of kernel booting working, I can certainly help with the Darwin-specific stuff, resolving "hardware" related panics, DSDT edits, kexts etc. Although I now seem to recall also having problems trying to use the "acpi -e" function to load an alternate DSDT.

Because of lack of sources as well as my own lack of knowledge, I looked at but did not try XPC, iBoot (EFI booted not the Chameleon-based thing) etc. As mentioned, I got nowhere with ReFit...but though that it ought to be a good place to start. Just got too complex to figure it out!
User avatar
hawsey
Posts: 2077
Joined: Sun May 22, 2011 11:23 pm
Location: Northumberland

Re: Is it Possable To Run Darwin/x86 On Joggler

Post by hawsey »

This may be helpful, i just came across it looking for something else

http://www.projectosx.com/forum/index.p ... topic=1423
Cheers
Happy Joggling
User avatar
Mevi
Posts: 774
Joined: Tue Oct 25, 2011 4:39 pm

Re: Is it Possable To Run Darwin/x86 On Joggler

Post by Mevi »

GoOd find. Thanks fidi for the info. I'm not a coder either, I get totally intimidated by a lot of code. :)
I've Got The Moves Like Joggler

Windows XP Professional SP3 plus Tablet PC for O2 Joggler
http://www.jogglerwiki.com/forum/viewto ... ?f=2&t=305

How to build your own Windows XP for the Joggler
http://www.jogglerwiki.com/wiki/WindowsXP
fidi
Posts: 4
Joined: Wed Dec 14, 2011 8:41 am

Re: Is it Possable To Run Darwin/x86 On Joggler

Post by fidi »

hawsey wrote:This may be helpful, i just came across it looking for something else

http://www.projectosx.com/forum/index.p ... topic=1423
Cheers
Aha. Forgot i written stuff there also. fidi=humph :D
danfoshizzle
Posts: 1271
Joined: Sun May 29, 2011 2:08 am
Location: somewhere near Rochester castle.

Re: Is it Possable To Run Darwin/x86 On Joggler

Post by danfoshizzle »

EFI and grub really are the stumbling blocks it seems, as the vaio p can run it lol
Fullscreen squeezeplay windows, server 2003, foshiz mini v1 and v2, (and a few broken builds) :P so far.....
more to come!!

Jogglers " Obi Wan" according to Pete_c :D
fidi
Posts: 4
Joined: Wed Dec 14, 2011 8:41 am

Re: Is it Possable To Run Darwin/x86 On Joggler

Post by fidi »

I see that Slice has posted his working Clover EFI-based boot loader over at http://www.projectosx.com/forum/index.p ... =2304&st=0
Wondering if that can be of any help to us. Sadly, still without Joggler, so can't experiment personally...
danfoshizzle
Posts: 1271
Joined: Sun May 29, 2011 2:08 am
Location: somewhere near Rochester castle.

Re: Is it Possable To Run Darwin/x86 On Joggler

Post by danfoshizzle »

No good with source code, so I'm not a tester either lol
Fullscreen squeezeplay windows, server 2003, foshiz mini v1 and v2, (and a few broken builds) :P so far.....
more to come!!

Jogglers " Obi Wan" according to Pete_c :D
Post Reply