Welcome, Guest. Please login or register.


Author Topic: Wiznet 5100/5300 /etc and Enterprise (Read 23780 times)

Offline BruceTanner

  • EP lover
  • *
  • Posts: 607
  • Country: gb
Re: Wiznet 5100/5300 /etc and Enterprise
« Reply #15 on: 2015.March.24. 14:04:48 »
EXDOS doesn't currently have a way of using other file systems - it would probably need a new version of EXDOS with a patch on the function call entry points to see if the drive letter is a network drive etc. But the command line part and IS-DOS don't know anything about FATs etc (mostly, anyway) - they just do EXDOS calls so DIR and COPY etc should just work. SMB was created to basically map MS-DOS calls to the network so there is quite a close correlation between EX-DOS and SMB :)

Offline lgb

  • EP addict
  • *
  • Posts: 3563
  • Country: hu
  • æðsta yfirmaður
    • http://lgb.hu/
Re: Wiznet 5100/5300 /etc and Enterprise
« Reply #16 on: 2015.March.24. 14:18:03 »
EXDOS doesn't currently have a way of using other file systems - it would probably need a new version of EXDOS with a patch on the function call entry points to see if the drive letter is a network drive etc. But the command line part and IS-DOS don't know anything about FATs etc (mostly, anyway) - they just do EXDOS calls so DIR and COPY etc should just work. SMB was created to basically map MS-DOS calls to the network so there is quite a close correlation between EX-DOS and SMB :)

OK, thanks for the information, it was always a white spot for me. I always think about something like the VFS layer in Linux kernel, eg there are common functions "open file", "read file" etc, and any number (even network FS) can be done to implement those entry points by a given filesystem "driver". I always wanted to find something like this in EXDOS, but it's quite possible that EXDOS has totally different philosophy here :)

Offline lgb

  • EP addict
  • *
  • Posts: 3563
  • Country: hu
  • æðsta yfirmaður
    • http://lgb.hu/
Re: Wiznet 5100/5300 /etc and Enterprise
« Reply #17 on: 2015.March.24. 14:29:37 »
Next question: does 5100 and 5300 some kind of pre-allocated mac address per chip, or the user must provide "something"? According to the documentation of the w5300 it mentions a register named "SHAR" which is about to configure MAC address, so I guess we must provide a mac address. I don't know how MSX guys solved the problem, as it's a big problem if mac addresses collides, the situation is not so rare, if every wiz carts have the same MAC and eg in case of a 8 bit party :) people want to connect their machines on the same ethernet segment. Also, mac addresses should not be given just by random, as they are allocated by vendor at least at the "prefix" level. If someone does not hate Commodore too much (as some Z80 CPU believer does hehe), Commodore does have an allocated mac address space which is not so much used for obvious reasons , and often used by "retro computing" projects. But of course it still does not resolve the whole problem for the need to generate unique mac addresses for every cartridges.

Offline BruceTanner

  • EP lover
  • *
  • Posts: 607
  • Country: gb
Re: Wiznet 5100/5300 /etc and Enterprise
« Reply #18 on: 2015.March.24. 15:22:59 »
I haven't looked into the MAC address yet but it seem likely the Wiz does not have its own - that would need some non-volatile storage which it probably does not have. The Enterprise network card ROM will be Flash, much of it unused, but the question is then whether just a small section can be written (I don't know the answer yet).

Each Enterprise has its own serial number so maybe the software can ask the user to type that in to make up a unique MAC address, if necessary "borrowing" a disused prefix as you suggest.

Offline Prodatron

  • EP user
  • *
  • Posts: 256
  • Country: de
  • Back on the Z80
    • http://www.symbos.de
Re: Wiznet 5100/5300 /etc and Enterprise
« Reply #19 on: 2015.March.24. 15:39:20 »
Wow, you are faster than my thoughts :) I was just about to ask you what MSX uses, direct or indirect with that DenYoNet. I tried to find information about DenYoNet (schematics, detailed description, programming etc) but not so much success yet, can you help in that? I guess it would help a lot to see how MSX guys solved the problems (or even cared at all ...) I talked about like logic level shifting. Anyway, maybe you're right and indirect access is more simple with using some I/O ports only, and nothing more ...
The DenYoNet card is using the memory of a full MSX slot/subslot (this is a 4x16K range which can be partially or fully mapped into the visible 64K area). The lower 32K are for the included flash ROM, in the upper 32K you can map the 32K of the W5100. This is separated into 2x16K, the lower are the registers, the higher are the transfer buffers. There are two additonal bits which select if and which part of the 32K is mapped to #8000 and if and which to #C000. Unfortunately I have no idea how this is done internally/wired, but it uses the memory-mapped based slot/subslot technology of the MSX standard.

@Bruce: SymbOS doesn't use the interrupt feature. It is polling the status of the 4 sockets on each Vblanc interrupt, which makes things easier for me.

Quote
"AppStore"
This is definitely planned!! :P

Quote
MAC address
Yes, you have to set the MAC address by yourself. On the MSX the producer of the card ("Sunrise") owns 4096 MAC addresses, which is enough :D (not sure about the exact range)

Offline lgb

  • EP addict
  • *
  • Posts: 3563
  • Country: hu
  • æðsta yfirmaður
    • http://lgb.hu/
Re: Wiznet 5100/5300 /etc and Enterprise
« Reply #20 on: 2015.March.24. 15:41:26 »
Another possibility to also use some kind of RTC chip. RTC is nice to have, ZT (ZozoTools) ROM can even display a clock shown above the normal status line, and used to initialize EXOS time/date settings. Well, having a network solution would allow to set time with NTP, RDATE or similar network time protocol that's true. But what I mean with RTC: some RTC chips have NVRAM which is quite suitable to contain small amount of configuration data, as it does with ordinary PC BIOSes as well something like 56 bytes or such is free by the clock functions, if I remember correctly. Ok, it's not truely volatile, as battery can flat, but software can ask for EP serial number if the data seems to be invalid, and then it's re-set, and also MAC address is generated somehow from the serial number, as you pointed out, as it should be unique somehow at least :) But I am not sure it's worth to also build an RTC solution onto the card, even if it can be useful. The flash idea is not so bad, and usually it should be set once, so I guess it's not a big deal to re-flash a whole flash page because of that (as far as I know, flashes can be written only per page, not at byte  level though). EEPROM is another solution, but it's more expensive with capacity needed for the software, and a small EEPROM is a bit luxury to have just for the MAC address when you have flash too ...

Offline Zozosoft

  • Global Moderator
  • EP addict
  • *
  • Posts: 14710
  • Country: hu
    • http://enterprise.iko.hu/
Re: Wiznet 5100/5300 /etc and Enterprise
« Reply #21 on: 2015.March.24. 15:46:45 »
The flash idea is not so bad, and usually it should be set once, so I guess it's not a big deal to re-flash a whole flash page because of that (as far as I know, flashes can be written only per page, not at byte  level though).
No, only the erase works with pages. Then the erased bytes (FFh) can be written. (At the write you can overwrite 1 to 0, but can't 0 to 1)

Offline lgb

  • EP addict
  • *
  • Posts: 3563
  • Country: hu
  • æðsta yfirmaður
    • http://lgb.hu/
Re: Wiznet 5100/5300 /etc and Enterprise
« Reply #22 on: 2015.March.24. 15:52:26 »
No, only the erase works with pages. Then the erased bytes (FFh) can be written. (At the write you can overwrite 1 to 0, but can't 0 to 1)

Ah, my fault, indeed. So, by creating cards there can be erased bytes (FFh) and it's OK to set some bytes for the serial number or whatever at once by the user at the very first time. Of course, it's important to warn the user that he should not make mistakes :)

Offline lgb

  • EP addict
  • *
  • Posts: 3563
  • Country: hu
  • æðsta yfirmaður
    • http://lgb.hu/
Re: Wiznet 5100/5300 /etc and Enterprise
« Reply #23 on: 2015.March.24. 17:22:22 »
Quote
So most work is just interfacing with the W5100, but also implementing DNS lookup (and DHCP)

DNS shouldn't be a big issue, it's just an UDP datagram sent to the recursive DNS server IP port 53, and waiting for the answer. Well, at least if no EDNS ... and you don't want to support DNSSEC :) Just kidding. I guess if message is truncated (on PC etc, client would retry the query over TCP then) then it can be ignored on an EP or similar system anyway, though there can be situations like a server has over 100 IP addresses for some kind of odd DNS based round-ribon load balancing idea, I've already seen things like this even with well defined DNS lookup type, not just with "ANY" lookup which is quite expensive nowdays (and used in DNS based DDoS attacks ...).

At the other hand DHCP is somewhat more complex at least. Especially if you need to receive routes as well, but I guess more home networks you want to use this wouldn't have too long routing table, just the default gateway maybe :) Or wait, that should be handled by the wiz chip as in non-MACRAW mode at least, you deal with IP addresses only, right? DHCP as I can imagine needs some MACRAW magic as well, since at the beginning you don't have IP address.

Since Enterprise's great OS (EXOS) is quite capable, I guess the best solution would be to let EXOS to do the intial work if you have such a network card (eg it can do DHCP like with the SD card detection before the Enterprise logo) SymbOS can query EXOS somehow (?) about it. But I am not sure, even not without SymbOS, eg user may want static IP configuration, and then anyway you need to store at least your own IP (not counting the MAC address now ... that's another story), DNS server ... But again, relaying for SymbOS on just EXOS may cause just even more complex situation among SymbOS platform, because at least I can imagine you want an own DHCP routine, network configuration dialog etc anyway, so Enterprise port would be a "special case" then. Speaking about the EP/EXOS only, some kind of non-volatile storage seems to be important again, not just because of MAC address but maybe in case static IP configuration too (or to avoid doing DHCP always even before the end of the lease time given by the DHCP server).

Anyway, what I would enjoy to have a fully usable network solution even with the base EP OS too, of course! :)

No, we need an IPv6 capable wiznet chip, btw :-D

Offline Prodatron

  • EP user
  • *
  • Posts: 256
  • Country: de
  • Back on the Z80
    • http://www.symbos.de
Re: Wiznet 5100/5300 /etc and Enterprise
« Reply #24 on: 2015.March.24. 19:55:32 »
My first thought about the RTC was, that you don't need an RTC anymore if you have network, as you can get the time from the internet after startup and you are fine. The small included RAM is an interesting point. But especially because of the multi-platform way I would always store all settings in an INI file, which is loaded, when the network daemon is starting. This is probably different, when we speak about a ROM solution, which should be independant of mass storage devices.

Good to hear, that DNS is easy. It's what I am starting now to implement, since the UDP routines are finished. About DHCP, the way I am currently doing it on the MSX is exactly the way you described! I let the DenYoNet rom do the initialisation with DHCP in MSX-DOS, and after this I boot SymbOS. So the Wiznet already has all its basic network settings.
Didn't know that DHCP requires MacRaw. I thought that even without any network setting you are able to broadcast UDP packets. Anyway not so important now, I think this is one of the last items on the list! :)

Offline lgb

  • EP addict
  • *
  • Posts: 3563
  • Country: hu
  • æðsta yfirmaður
    • http://lgb.hu/
Re: Wiznet 5100/5300 /etc and Enterprise
« Reply #25 on: 2015.March.24. 22:15:42 »
My first thought about the RTC was, that you don't need an RTC anymore if you have network,

Exactly my idea was this too, as I've mentioned. Not so easy to decide eg, ok-ok but time keeping in an interrupt handler always problematic (sometimes you need to disable interrupts and miss a tick, though on Ep the 1Hz interrupt source is a useful stuff), so the RTC is a quicker and more easy way, than always using eg ntp to get "time from the net", but I am still unsure which is the best :) In theory even SD card or _any_ storage is not needed as I would prefer using my router as "storage" even for the EP through the network, so what's the point of an SD card then in the EP? :) Now I talk about in general btw, not just SymbOS, EP/EXOS too.

Quote
Didn't know that DHCP requires MacRaw. I thought that even without any network setting you are able to broadcast UDP packets.

Hmm, maybe you're right :)

Offline Prodatron

  • EP user
  • *
  • Posts: 256
  • Country: de
  • Back on the Z80
    • http://www.symbos.de
Re: Wiznet 5100/5300 /etc and Enterprise
« Reply #26 on: 2015.May.04. 14:26:36 »
As I read in the All-In-One thread there is currently some development going on with the Wiznet W5x00 hardware?
Any news about this or is it currently too far away from publishing details? :)
[ Guests cannot view attachments ]
I hope to get the network daemon for SymbOS finished soon, and TBH the low level drivers for the platform/hardware specific part is not much work compared to the management stuff around it.

Offline lgb

  • EP addict
  • *
  • Posts: 3563
  • Country: hu
  • æðsta yfirmaður
    • http://lgb.hu/
Re: Wiznet 5100/5300 /etc and Enterprise
« Reply #27 on: 2015.May.04. 15:53:57 »
Sorry but there is still no like button here to express feelings about some posts :) I don't know about the network project on the EP other than discussing various topics here. But as far as I remember, Bruce wrote something that he wants to create a solution. And about myself: I have only big mouth but quite lazy and lacking enough free time. Oh well, these excuses all the time ... Fortunately I am not the author of SymbOS otheriwse it would be never written :)

Offline Tuby128

  • EP addict
  • *
  • Posts: 1453
  • Country: hu
Re: Wiznet 5100/5300 /etc and Enterprise
« Reply #28 on: 2015.May.04. 15:56:27 »
(For EN version see bottom)
DE:
Ich denke gerade daran, ob ein ENC28J60 für diese Zweck ausreichend wäre. Das IC kann 10mbps, mehr brauchen wir sowieso nicht. Um das IC mit EP verbinden würde ich ein MAX2 CPLD nehmen. Kostet nicht viel, und somit kann man die SPI schnittstelle zum paraller EP anpassen. Das einzige Nachteil ist, dass man diese IC studieren muss, um das zu steuern.
 Ich bin der Meinung ein memory-mapped Zugriff wäre am beste Lösung, weil es beim Z80 schneller als IO Zugriff.

EN:
I am thinking right now, whether a ENC28J60 would be good for this purpose. This IC can 10mbps, we don't need more. To interface it to EP, I would take a MAX2 CPLD. It cost's not much, and thus the SPI can interface with paraller EP externsion. The only disdvantage is that we have to learn how to control the IC.
 In my oppinion a memory-mapped access would be the best solution, because at Z80 it is faster as IO access.

HU:
 Azon gondolkodom, hogy egy ENC28J60 talán megfelelne erre a célra. Ez az IC 10 mbps-t tud, többre nincs is szükségünk. Hogy összekapcsoljuk az EP-vel, én egy MAX2 CPLD-t használnék. Nem kerül sokba, és így az SPI összehozható a párhuzamos EP-vel. Az egyetlen hátránya, hogy meg kell tanulnuk vezérelni az IC-t.
 Szerintem egy memóriában leképzett hozzáférés lenne a legjobb megoldás, mert a Z80-nál ez gyorsabb mint az IO hozzáférés.
« Last Edit: 2015.May.04. 16:43:19 by Tuby128 »

Offline lgb

  • EP addict
  • *
  • Posts: 3563
  • Country: hu
  • æðsta yfirmaður
    • http://lgb.hu/
Re: Wiznet 5100/5300 /etc and Enterprise
« Reply #29 on: 2015.May.04. 16:22:17 »
I am thinking right now, whether a ENC28J60 would be good for this purpose. This IC can 10mbps, we don't need more. To interface it to EP, I would take a MAX2 CPLD. It cost's not much, and thus the SPI can interface with paraller EP externsion. The only disdvantage is that we have to learn how to control the IC.
 In my oppinion a memory-mapped access would be the best solution, because at Z80 it is faster as IO access.

We have had some posts about that in the past, as far as I can remember. I suggested ENC28J60 too at first. However the problem, that you need create a full TCP/IP stack by yourself on the Enterprise, since ENC28J60 does not have higher level functionality. Well, first I thought it's not a problem, anyway it feels like cheating to use a "hardware" TCP/IP solution (actually an embedded MCU which is much more powerful than the Z80 itself in the EP), but after considering these facts I am not so sure anymore:

* SymbOS already (well, AFAIK, and only in development versions, I think) supports the wiznet chip (with "hardware" tcp/ip) for the MSX (wiznet w5100). Chance to implement the whole TCP/IP as well is much lower than adopt the MSX-like solution for the EP too, almost the same driver.
* Implementing a full TCP/IP stack for EP would require time (well maybe there are Z80 TCP/IP project already, but even just adopting)
* A software TCP/IP solution require some amount of resources (memory, CPU) again ... Then a stock EP would be not so much usable with 128K of RAM only (see the EXOS driver idea later)
* The mentioned wiznet chips has direct 8 bit CPU bus interface as well, basically you can just wire together without too much extra components or extra programmable logic devices, no need for even SPI
* wiznet chips are faster (ok, honestly it's not a point too much, 10mbit would be enough as well!!!!)
* You can even buy (I have) these wiznet chips in the form of modules (ok, it's true for the ENC28J60 too, I know) with integrated RJ45, etc, quite ready to be used even for someone like me (anti-SMD guy)

Btw, even before the SD card cartridge my dream was having a generic SPI bus implementation, and you can connect some SPI slaves, like ENC28J60, SD card, and even extra things SPI capable mpeg codec ICs just for fun.

After all, I think, it's much more realistic to have working ethernet solution (and softwares use it!) if it's easy to made (wiring a wiznet module to the EP etc) even if it's not "manufactured" unlike the SD card cartridge, and also it's much more easy to write software (not just SymbOS, think about the nice possibilities to have EXOS drivers for it, like LOAD "http://...." directly) for it. Even if it's a bit more expensive (not so much, even that module was something like 6000HUF) and feels "cheating" sometimes :)

Ah yes, and a bonus: these wiznet chips still allow low level programming if some wants to implement everything without the help of the chip itself beyond the ethernet layer at least ...
« Last Edit: 2015.May.04. 22:24:47 by lgb »