Skip to content

Commit

Permalink
Speed improvements + little fixes + 0.0.2 release
Browse files Browse the repository at this point in the history
- Converted condition-code + physical_get/set switch statements to jump tables
- Moved the pmmu_cache lookup code out of translate_logical_addr
- Broke MOVE into move-to-datareg, -from-datareg, and datareg-to-datareg
- Fixed UFS code to ignore high 32 bits of inode size (it sometimes contains garbage)
- Support for zero-length reads in scsi.c + 256kb read/write buffer
- pushing interrupt stack frames now actually changes the priority mask
- Updated the READMEs, screencaps for 0.0.2
  • Loading branch information
pruten committed Apr 26, 2014
1 parent cc2bb3c commit 9f0e6ed
Show file tree
Hide file tree
Showing 16 changed files with 933 additions and 927 deletions.
7 changes: 5 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@

all: shoebill

shoebill: make_core
shoebill: make_gui

make_gui: make_core
xcodebuild -project gui/Shoebill.xcodeproj SYMROOT=build

make_core:
$(MAKE) -C core -j 4

clean:
rm -rf intermediates
rm -rf intermediates gui/build
10 changes: 7 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,17 @@ A Macintosh II emulator that runs A/UX (and A/UX only).

Shoebill is an all-new, BSD-licensed Macintosh II emulator designed from the ground up with the singular goal of running A/UX.

A/UX 1.x.x through 2.0.0 are supported currently, and 3.x.x support is in progress.

Shoebill requires a OS X, a Macintosh II or IIx ROM, a disk image with A/UX installed, and an A/UX kernel.
Shoebill requires a OS X, a Macintosh II, IIx or IIcx ROM, and a disk image with A/UX installed.

[Download the latest release], and then see the [getting started] wiki.
Also check out [screenshots].

__Update (April 26, 2014): Shoebill 0.0.2 is available, and it supports A/UX 3.0.0! And you no longer need to supply your own kernel.__


####Supports
* A/UX 1.1.1 through 3.0.0 (but not 3.0.1 or higher, yet)

####Currently Implements
* 68020 CPU (mostly)
* 68881 FPU (a little)
Expand Down
31 changes: 15 additions & 16 deletions README.txt
Original file line number Diff line number Diff line change
@@ -1,17 +1,13 @@

Shoebill - a Macintosh II emulator that runs A/UX
(except A/UX 3.x.x currently)


See the wiki on https://github.com/pruten/shoebill for better
documentation on building and running Shoebill.

*** KEEP IN MIND ***

* Shoebill v.first-terrible-code-drop (a.k.a. version 0.0.1)
* Shoebill v.0.0.2
* ONLY RUNS A/UX
* BUT NOT 3.x.x (I’m working on it)
* Only 1.x.x and 2.x.x
* Shoebill has broken, ultra-minimalist support for
* 68020 (CPU) + 68851 (MMU) + 68881 (FPU)
* Some instructions for ‘020 and most for the MMU and FPU are unimplemented
Expand All @@ -26,14 +22,11 @@ documentation on building and running Shoebill.
*** RUNNING ***

You will need
* OS X and a 64-bit Intel Macintosh
(32-bit builds are possible by twiddling the makefiles)
* A Macintosh II or IIx ROM
* A disk image with A/UX 1.x.x or 2.x.x installed
* OS X 10.8 or 10.9
* A Macintosh II, IIx, or IIcx ROM
* A disk image with A/UX 1.x.x or 2.x.x, or 3.0.0 installed
* Note: 3.0.1 and 3.1.x do not work!
* If you happen to have an installation CD image for A/UX, that will work
* The kernel on that image (/unix). Shoebill can’t read
SVFS or UFS file sytems yet to load the kernel directly
from the disk image.


To boot A/UX
Expand All @@ -42,15 +35,21 @@ To boot A/UX
will very likely be corrupted - sometimes so severely
that A/UX can’t even boot enough to run fsck.
* Open Shoebill.app and select Preferences menu item
* Set the paths for your ROM, kernel, and disk image(s).
* Set the paths for your ROM and disk image(s).
* Do use SCSI ID #0 for your A/UX boot image.
* Press “Apply and Run”
* Press “Apply and Run”
* Note: As of 0.0.2, you no longer need to provide your own kernel file


*** BUILDING ***

1) cd to shoebill/
2) make # to build shoebill_core
3) xcodebuild -project gui/Shoebill.xcodeproj # to build the Cocoa GUI
2) make
3) The resulting app will be in gui/build



*** ETC. ***
Props to Jared Falter for technical and emotional support!


3 changes: 2 additions & 1 deletion core/Makefile
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@

CC = clang
CFLAGS = -O3 -flto -ggdb -Wno-deprecated-declarations
# CFLAGS = -O0 -ggdb -Wno-deprecated-declarations


DEPS = core_api.h coff.h mc68851.h redblack.h shoebill.h Makefile macro.pl
NEED_DECODER = cpu dis
NEED_PREPROCESSING = adb fpu mc68851 mem via
NEED_NOTHING = atrap_tab coff exception floppy macii_symbols redblack scsi toby_frame_buffer video core_api filesystem debug_server
NEED_NOTHING = atrap_tab coff exception floppy macii_symbols redblack scsi toby_frame_buffer video core_api filesystem debug_server alloc_pool

# Object files that can be compiled directly from the source
OBJ_NEED_NOTHING = $(patsubst %,$(TEMP)/%.o,$(NEED_NOTHING))
Expand Down
95 changes: 95 additions & 0 deletions core/alloc_pool.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
/*
* Copyright (c) 2014, Peter Rutenbar <[email protected]>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

#include <stdlib.h>
#include <assert.h>
#include <stdint.h>
#include "../core/shoebill.h"

/*typedef struct _alloc_pool_t {
struct _alloc_pool_t *prev, *next;
uint32_t size, magic;
} alloc_pool_t;*/

void* p_alloc(alloc_pool_t *pool, uint64_t size)
{
alloc_pool_t *buf = calloc(sizeof(alloc_pool_t) + size, 1);
buf->size = size;
buf->magic = 'moof';

buf->next = pool->next;
buf->prev = pool;

if (pool->next)
pool->next->prev = buf;
pool->next = buf;

return &buf[1];
}

void* p_realloc(void *ptr, uint64_t size)
{
alloc_pool_t *header = &((alloc_pool_t*)ptr)[-1];
alloc_pool_t *new_header = realloc(header, size + sizeof(alloc_pool_t));

if (new_header)
return &new_header[1];

return NULL;
}

void p_free(void *ptr)
{
alloc_pool_t *header = &((alloc_pool_t*)ptr)[-1];
assert(header->magic == 'moof');

if (header->next)
header->next->prev = header->prev;

if (header->prev)
header->prev->next = header->next;

free(header);
}

void p_free_pool(alloc_pool_t *pool)
{
while (pool->prev)
pool = pool->prev;

while (pool) {
alloc_pool_t *cur = pool;
pool = cur->next;
assert(cur->magic == 'moof');
free(cur);
}
}

alloc_pool_t* p_new_pool(void)
{
alloc_pool_t *pool = calloc(sizeof(alloc_pool_t), 1);
pool->magic = 'moof';
return pool;
}
Loading

0 comments on commit 9f0e6ed

Please sign in to comment.