Project

General

Profile

Actions

Bug #573

closed

DragonFly on Intel Mac?

Added by qhwt+dfly almost 18 years ago. Updated over 17 years ago.

Status:
Closed
Priority:
Low
Assignee:
-
Category:
-
Target version:
-
Start date:
Due date:
% Done:

0%

Estimated time:

Description

Hi.
Although it runs fine on Parallels Desktop(an emulator), it doesn't
with BootCamp. LiveCD stops twirling the baton prematurely.
There's been some good efforts in FreeBSD to install and boot on
MacBook Pro via BootCamp last year, and I confirmed that 6.2-RELEASE
installs and runs almost fine. I searched through their commit log, and
ported the relavant parts (patch attached). MacBook Pro is a legacy-free
hardware and has no keyboard controller, and the patch puts upper limit
on the amount of time to wait for the controller to be ready (or give up),
according to their commitlog.

With this patch, it does boot past the boot loader, but it ends up
in double fault after many lines of 'sched_ithd: stray interrupt 7'.
Also I need to disable acpi driver because it fills the screen with
garbage and I can't see anything in the boot log. I tested cdboot
and the kernel on other PCs and had no problem. So it's probably
safe to commit.

I'm currently playing with it installed in a spare partition of
FreeBSD 6.2-RELEASE installation. The hardest part is that even
on FreeBSD, the keyboard rarely work until the OS boots up (and I saw
this with SuSE too). In fact it's easier edit /boot.config and
/boot/loader.conf from FreeBSD installation than keep punching the
power button :) This may or may not be BootCamp's fault. I hope to post
a few more positive news/patch soon.

Cheers.


Files

a20.patch (4.87 KB) a20.patch qhwt+dfly, 03/06/2007 01:50 PM
a20.patch (6.27 KB) a20.patch qhwt+dfly, 03/11/2007 06:58 AM
Actions #1

Updated by dillon almost 18 years ago

:Hi.
:Although it runs fine on Parallels Desktop(an emulator), it doesn't
:with BootCamp. LiveCD stops twirling the baton prematurely.
:There's been some good efforts in FreeBSD to install and boot on
:MacBook Pro via BootCamp last year, and I confirmed that 6.2-RELEASE
:installs and runs almost fine. I searched through their commit log, and
:ported the relavant parts (patch attached). MacBook Pro is a legacy-free
:hardware and has no keyboard controller, and the patch puts upper limit
:on the amount of time to wait for the controller to be ready (or give up),
:according to their commitlog.
:
: With this patch, it does boot past the boot loader, but it ends up
:in double fault after many lines of 'sched_ithd: stray interrupt 7'.
:Also I need to disable acpi driver because it fills the screen with
:garbage and I can't see anything in the boot log. I tested cdboot
:and the kernel on other PCs and had no problem. So it's probably
:safe to commit.
:
:I'm currently playing with it installed in a spare partition of
:FreeBSD 6.2-RELEASE installation. The hardest part is that even
:on FreeBSD, the keyboard rarely work until the OS boots up (and I saw
:this with SuSE too). In fact it's easier edit /boot.config and
:/boot/loader.conf from FreeBSD installation than keep punching the
:power button :) This may or may not be BootCamp's fault. I hope to post
:a few more positive news/patch soon.
:
:Cheers.

There's something going on with the stray irq printf() itself
possibly being the cause of the double fault. I think the printf()
in that situation (interrupting random kernel code without MP lock
controls) is not safe.
Except for the interrupt disablement and reenablement bits, I like
the patch. I don't think those bits are necessary.
It may also be a good idea to put a DELAY() in the C code loop instead
of relying on ISA bus timing (which won't actually be ISA bus timing
because the ISA bus is faked these days). I'm not sure what
the best solution would be for the assembly. It might not be a big
deal but it could save us headaches later on.
-Matt
Actions #2

Updated by justin almost 18 years ago

On Tue, March 6, 2007 8:41 am, YONETANI Tomokazu wrote:

If you have a disk image to try out, I can give it a whirl on my MacBook Pro.

Actions #3

Updated by qhwt+dfly almost 18 years ago

Ripped the interrupt disablement and reenablement bit and it works.
Also the previous patch missed changes to dev/misc/kbd .

The commit log for original patch doesn't seem to be very determined about
the amount of time to wait. Inserting DELAY can gurantee to wait
at least for one second before giving up.

You mean the hard disk image? Maybe you can install it to a BootCamp
partition(mine appears as /dev/disk0s3) using `dd' command from Mac OS X,
but I haven't tried it yet. On FreeBSD, the disk appears to be ad5s3, but
I could use boot0cfg, so I imagine just installing the slice image doesn't
make it bootable. I need to investigate on this later.

Cheers.

Actions #4

Updated by justin almost 18 years ago

On Sun, March 11, 2007 1:51 am, YONETANI Tomokazu wrote:

I had meant an ISO, though I suppose if you commit this, I can just use a
1.9 build from chlamydia. I haven't really looked at the disk
partitioning process, but I think I can break out a third/fourth partition
and install swap/normal disk to that.

Actions #5

Updated by dillon almost 18 years ago

:+ for (i = 0; i != 65535; i++) {
:+ if ((bus_space_read_1(tag, ioh1, 0) & 0x2) 0)
:+ break;
:+ }
:+ if (i 65535) {
:+ bus_release_resource(dev, SYS_RES_IOPORT, 0, port0);
:+ bus_release_resource(dev, SYS_RES_IOPORT, 1, port1);
:+ return ENXIO;
:+ }

Do this instead:
for (i = 65536; i != 0; --i) {
...
}
if (i == 0) {
...
}
Ok, its a nit, but you aren't duplicating the counter constant and
not depending on the compiler to optimize the constant. And the code
is a bit smaller.
-Matt
Actions #6

Updated by corecode over 17 years ago

do you intend to commit this?

Actions #7

Updated by qhwt+dfly over 17 years ago

Thanks for the reminder, I'll take care of it this weekend.

Cheers.

Actions

Also available in: Atom PDF