NeXT Computers Forum Index NeXT Computers
www.NeXTComputers.org
 
Log in to check your private messagesLog in to check your private messages

Log inLog in  RegisterRegister


Profile  Search  Memberlist  FAQ  Usergroups
What Needs to be done for a NeXT Emulator
Goto page Previous  1, 2, 3, ... 75, 76, 77  Next
 
Post new topic   Reply to topic    NeXT Computers Forum Index -> Emulation / Virtualization
View previous topic :: View next topic  
Author Message
bkmoore



Joined: 01 Jan 2009
Posts: 183
Location: Germany

PostPosted: Thu Sep 16, 2010 11:12 pm    Post subject: Reply with quote

Another advantage of an open-source M68K emulator is it could be ported to older PPC Macs which have no good x86 options for NeXT emulation.
Back to top
View user's profile Send private message
gilles



Joined: 03 Sep 2009
Posts: 117

PostPosted: Fri Sep 17, 2010 1:11 am    Post subject: Reply with quote

Probably QEMU would be a good platform to run next68k but a real emulator is a necessary step. Many hardware registers are not documented, in particular the DMA chip. The only partial informations I found are in netBSD sources but comments are a bit short Smile.

Emulator is now blocked in some rtc chip reading or config. I found a similar code in netBSD rtc.c source.

In very early POST, the stack resides at the end of video RAM in $0B0307xx
_________________
http://previous.alternative-system.com
http://www.alternative-system.com/?lang=EN
Back to top
View user's profile Send private message Send e-mail
ebann



Joined: 05 Sep 2010
Posts: 45

PostPosted: Fri Sep 17, 2010 4:02 am    Post subject: Reply with quote

I think that progress would be much faster if you used Basilisk II source code as your base.

http://basilisk.cebix.net/

It uses the UAE 68k CPU emulator engine and the source code is very very modular.

- UAE CPU engine ("uae_cpu/*", not needed on all systems)
- ROM patches ("rom_patches.cpp", "slot_rom.cpp" and "emul_op.cpp")
- resource patches ("rsrc_patches.cpp" and "emul_op.cpp")
- PRAM Utilities replacement ("xpram.cpp")
- ADB Manager replacement ("adb.cpp")
- Time Manager replacement ("timer.cpp")
- SCSI Manager replacement ("scsi.cpp")
- video driver ("video.cpp")
- audio component ("audio.cpp")
- floppy driver ("sony.cpp")
- disk driver ("disk.cpp")
- CD-ROM driver ("cdrom.cpp")
- external file system ("extfs.cpp")
- serial drivers ("serial.cpp")
- Ethernet driver ("ether.cpp")
- system-dependant device access ("sys_*.cpp")
- user interface strings ("user_strings.cpp")
- preferences management ("prefs.cpp" and "prefs_editor_*.cpp")

Basilisk II has been ported to the following systems:

Unix with X11 (Linux i386/x86_64, Solaris 2.5, FreeBSD 3.x, IRIX 6.5)
Mac OS X (PowerPC and Intel)
Windows NT/2000/XP
BeOS R4 (PowerPC and Intel)
AmigaOS 3.x

You can immensely simplify the code by eliminating the diverse types of emulator modes:

"Basilisk II is designed to run on many different hardware platforms and on
many different operating systems. To provide optimal performance under all
environments, it can run in four different modes, depending on the features
of the underlying environment (the modes are selected with the REAL_ADDRESSING,
DIRECT_ADDRESSING and EMULATED_68K defines in "sysdeps.h")"
Back to top
View user's profile Send private message
gilles



Joined: 03 Sep 2009
Posts: 117

PostPosted: Fri Sep 17, 2010 4:29 am    Post subject: Reply with quote

Basilisk is a good emulator but it uses an old variant of uae without real support of MMU (at least it was the case last time I read the code).
An atari TT is much close to a next than a mac, MMU is used by system.
hatari/aranym is a good base for now, to explore the POST rom, it was not too difficult to remove items but it may be a bit limited for timed events (centered on video/cpu/mfp).

For now, the real time clock must be added...
_________________
http://previous.alternative-system.com
http://www.alternative-system.com/?lang=EN
Back to top
View user's profile Send private message Send e-mail
gilles



Joined: 03 Sep 2009
Posts: 117

PostPosted: Fri Sep 17, 2010 5:52 am    Post subject: Reply with quote

after reading Basilisk code Wink
MMU support seems limited to mac with some black magic :

Code:
void REGPARAM2 frame_host_565_lput(uaecptr addr, uae_u32 l)
{
    uae_u32 *m;
    m = (uae_u32 *)(FrameBaseDiff + addr);
    l = (l & 0x001f001f) | ((l << 1) & 0xffc0ffc0);
    *m = swap_words(l);
}

but I agree the code is clear and easy to navigate while hatari is more demo-coder oriented Wink
[edit]
the code sample is a bit wrong, this is videoram access, MMU is not emulated by Basilisk that is limited to a 68020 CPU with a flat 32bit memory model
_________________
http://previous.alternative-system.com
http://www.alternative-system.com/?lang=EN
Back to top
View user's profile Send private message Send e-mail
jvernet



Joined: 02 Jan 2006
Posts: 78

PostPosted: Mon Sep 20, 2010 2:41 am    Post subject: Reply with quote

Is there somewhere documentation about NeXT harware ? Something else and more detailled than schematics that can be found ?

I took a look in my NeXT Archive DVDs but can find anything interesting wich may help Gilles....

Wee ned a Technical Specifications Manual....

Edit
Seems that there is some information form NeXT, see here

A lot of link are dead, now, like peak, channelu... Sad Somes mirros: http://nextstuff.info/
_________________
--
Apple & NeXT
Back to top
View user's profile Send private message Send e-mail Visit poster's website
gilles



Joined: 03 Sep 2009
Posts: 117

PostPosted: Mon Sep 20, 2010 7:10 am    Post subject: Reply with quote

in particular we need information about System control registers 1 & 2 that resides in x0200Cxxx and x0200Dxxx

SCR2 should be real time clock.

We have datasheets of the clock component (at least the old 68HC68T1) but don't know how it is connected to next (access to component are serial).
_________________
http://previous.alternative-system.com
http://www.alternative-system.com/?lang=EN
Back to top
View user's profile Send private message Send e-mail
gilles



Joined: 03 Sep 2009
Posts: 117

PostPosted: Mon Sep 20, 2010 8:38 am    Post subject: Reply with quote

found this interesting message of monitor in some doc:

Memory Configurations - m
---------------------
The m command displays information on the memory installed in sockets 0
through 15 (the original NeXT had 16 RAM slots). The output should be
something like this:

NeXT>m
Memory sockets 0-3 have 4MB page mode SIMMs installed (0x4000000-0x4400000)
Memory sockets 4-7 have 4MB page mode SIMMs installed (0x5000000-0x53fe000)
Memory sockets 8-11 have no SIMMS installed (0x0-0x0)
Memory sockets 12-15 have no SIMMS installed (0x0-0x0)
NeXT>

=> may means that a part of RAM is used for something else, maybe to shadow a part of the ROM?
_________________
http://previous.alternative-system.com
http://www.alternative-system.com/?lang=EN
Back to top
View user's profile Send private message Send e-mail
gilles



Joined: 03 Sep 2009
Posts: 117

PostPosted: Mon Sep 20, 2010 1:13 pm    Post subject: Reply with quote

good news, some information seems correct.

you need to force the boot, otherwise it goes in an endless loop (soft power off?)

r A7=$0B03F7C4
r PC=$01004956

first screenshot :



I'll update svn sources soon
_________________
http://previous.alternative-system.com
http://www.alternative-system.com/?lang=EN
Back to top
View user's profile Send private message Send e-mail
jvernet



Joined: 02 Jan 2006
Posts: 78

PostPosted: Mon Sep 20, 2010 1:21 pm    Post subject: Reply with quote

clapclapclap !

Very Happy
_________________
--
Apple & NeXT
Back to top
View user's profile Send private message Send e-mail Visit poster's website
gilles



Joined: 03 Sep 2009
Posts: 117

PostPosted: Mon Sep 20, 2010 2:05 pm    Post subject: Reply with quote

fixed display details:



(now my laptop screen is not large enough)
_________________
http://previous.alternative-system.com
http://www.alternative-system.com/?lang=EN
Back to top
View user's profile Send private message Send e-mail
gilles



Joined: 03 Sep 2009
Posts: 117

PostPosted: Mon Sep 20, 2010 3:44 pm    Post subject: Reply with quote

svn is updated.
To see the boot screen, you need the Rev2.6_v66.BIN file.
When screen gets scrambled (this pattern may be a video ram test),
type rightAlt + Pause
then in debugger
r A7=$0B03F7C4
r PC=$01004956

(it bypasses a test in ROM)

There is probably a ROM checksum, so cannot patch binary for now...
_________________
http://previous.alternative-system.com
http://www.alternative-system.com/?lang=EN
Back to top
View user's profile Send private message Send e-mail
gilles



Joined: 03 Sep 2009
Posts: 117

PostPosted: Tue Sep 21, 2010 11:48 am    Post subject: Reply with quote

think I understood how RTC is connected.
RTC is accessed with 2 bit write and 1 bit read from 32bit register SCR2.
to write you need to set data then loop clock with a delay
a write is 2 byte write, register then value
a read is a write for register then a read of value
maybe newer chip have a burst read mode.

netBSD sources are clear when you take them with the right angle Smile
_________________
http://previous.alternative-system.com
http://www.alternative-system.com/?lang=EN
Back to top
View user's profile Send private message Send e-mail
jvernet



Joined: 02 Jan 2006
Posts: 78

PostPosted: Tue Sep 21, 2010 1:24 pm    Post subject: Reply with quote

A little step more ! Nice Job !

I was able to build Previous on MacOsX. Still no debugger yet, need to change Alt-PAUSE to Alt-anythingelse. It should work, but no way....

Gilles really need help ! Very Happy
_________________
--
Apple & NeXT
Back to top
View user's profile Send private message Send e-mail Visit poster's website
gilles



Joined: 03 Sep 2009
Posts: 117

PostPosted: Tue Sep 21, 2010 1:39 pm    Post subject: Reply with quote

in configuration.c file:
ConfigureParams.Shortcut.withModifier[SHORTCUT_DEBUG] = SDLK_PAUSE;

change to another key more macosX friendly... (PAUSE/F16 seems problematic)
_________________
http://previous.alternative-system.com
http://www.alternative-system.com/?lang=EN
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    NeXT Computers Forum Index -> Emulation / Virtualization All times are GMT - 7 Hours
Goto page Previous  1, 2, 3, ... 75, 76, 77  Next
Page 2 of 77

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



Powered by phpBB © 2017 phpBB Group