wingsorc has joined #forth
<wingsorc> how do I access raw memory in forth. I want to read/write to memory mapped registers
<Zarutian_HTC> @ and !
<Zarutian_HTC> depends on the forth and where it is running
<wingsorc> I ported zforth to risc-v microcontroller. @ and ! seem to address relative to a internal dictionary
<Zarutian_HTC> but yeah @ ( addr -- cell ) and ! ( cell addr -- )
<wingsorc> DOes it make sense to offset the addresses for @! so that they coincide with the global memory map of my device?
<Zarutian_HTC> depends on the device
<wingsorc> but @ and ! are meant for raw memory access is that right?
<Zarutian_HTC> but usually that is what is done
<Zarutian_HTC> have not looked ar zforth in detail so I cannot say but in eForth and figforth that is the case
<Zarutian_HTC> you might want to look at how (variable) or dovar is implemented because that those words using that as their implementation are usually what precedes ! and @
<wingsorc> in zforth the dictionary is a static allocated array. This gets put into the bss which I then map to some non-zero address. This then means that 256 @ is not address 256 in the global memory map but rather 0x1c000000 or more
<Zarutian_HTC> bss? so there is some sort of minimal elf executable loader on this device or?
<Zarutian_HTC> or is the executable consumed by some proccess that spits out a raw .hex file or .srec file?
<wingsorc> zforth is written in c so a static array gets mapped to the bss section. In my linker script I just throw that into ram somewhere (ram is mapped to 0x1c00_0000). Yes there is initialization of the bss during the c runtime setup (crt0.S)
<Zarutian_HTC> so this isnt quite bare metal?
<wingsorc> yes I'm running it bare metal
<Zarutian_HTC> hmm, look if there is c@ and c! or p@ and p! words
<Zarutian_HTC> usually, forth that run on mcus (microcontrolers) do not have any c runtime anywhere
<wingsorc> but then what language is the interpeter written in?
<Zarutian_HTC> the boot vector points to raw_boot subroutine that sets the registers up for doing forth code
<Zarutian_HTC> oh boy, you have tumpled down this deep rabbit hole :)
<Zarutian_HTC> in forth there a
<Zarutian_HTC> re two 'interpreters'
<Zarutian_HTC> the outer one that takes forth source code and 'compiles' it
<Zarutian_HTC> while there is an inner one that is much much simpler one
<Zarutian_HTC> so the short answer is: the inner one and a few primitive words are written in assembly
<wingsorc> Ok I see but I think I haven't said exactly what I want to run: I want to have a forth shell running on the mcu (interaction over uart)
<Zarutian_HTC> look for the definition of KEY? and EMIT in zforth
<Zarutian_HTC> is https://github.com/zevv/zForth what you are working from?
<wingsorc> ah yes
<Zarutian_HTC> hmm seems to have emit but no key
<Zarutian_HTC> you need to read a char from the uart in that case block, I gather
<Zarutian_HTC> or define key to do a char get sys call
<Zarutian_HTC> wingsorc: does this help you at all?
<wingsorc> Oh I have zforth up and running on the mcu (wrote the glue already). I just was looking on how to add a memory access primitive that has a global view
<wingsorc> but I think the syscall thing could work. I could add a syscall that reads and writes from memory and give it a name?
<Zarutian_HTC> I tbink there are @@ and !! which seem to me to be the raw versions
<wingsorc> ah indeed
<Zarutian_HTC> btw what terminal program are you using to talk to the mcu?
<wingsorc> minicom
<wingsorc> the hardware is running on a fpga
<wingsorc> and I thought I could put forth as a fallback mode into the bootrom
<Zarutian_HTC> pretty much same but I often throw together a tcl/tk program or script to act as an application spefic terminal
<Zarutian_HTC> sound idea but I highly recommend eforth instead but you might have to do tedious port by translating the assembly
* Zarutian_HTC did it for dcpu-16 for the hell of it
<wingsorc> well I'm already halfway down the rabbit hole :)
<Zarutian_HTC> eforth is quite old but the e stands for education and porting it teaches one how a forth works inside out
<Zarutian_HTC> and the version I wrote took only about 6 KibiBytes
<Zarutian_HTC> in memory
<Zarutian_HTC> the assembler file grew to something like 256 KibiBytes
<wingsorc> is it from this website? http://www.forth.org/eforth.html
<Zarutian_HTC> yebb
<Zarutian_HTC> highly recommend the eforth materials plus the books Learning Forth and Thinking Forth which should be on that site
<Zarutian_HTC> and if you are into implementing the inner interp in fpga the I recommend https://excamera.com/sphinx/fpga-j1.html as something to look at
cp- has quit [Ping timeout: 256 seconds]
cp- has joined #forth
boru` has joined #forth
boru has quit [Disconnected by services]
boru` is now known as boru
cp- has quit [Quit: Disappeared in a puff of smoke]
cp- has joined #forth
wingsorc has quit [Quit: Leaving]
f-a has quit [Quit: of course it would use leeches as a currency]
<tabemann> Zarutian_HTC: I remember reading the book by C.H. Ting on eForth on the Atmega528 and the main thing that came off on me was how horrible of a platform it is to target for Forth
<Zarutian_HTC> tabemann: oh? I have only looked into porting eforth to atmega328p (the same chip ardunio uno uses)
<tabemann> wait
<tabemann> I must've misspoken then
<tabemann> because it did target the arduino chip
<Zarutian_HTC> though it needs the modified bootloader that I have not found again
<Zarutian_HTC> the one that has the 'write to program flash' modification
<tabemann> but yeah
<tabemann> the Atmega328p is not a good platform for Forth
<Zarutian_HTC> that is the only horribleness of that particular atmega chip that I recall at the moment
<tabemann> my zeptoforth runs on the STM32F407, STM32L476, and the STM32F746, and they're all much better platforms for Forth
<Zarutian_HTC> and the anemic ram too
<Zarutian_HTC> the one thing the atmega328p has going for it is it abundant availability
<tabemann> the reason why the Atmega328p is so popular is that it was one of the first MCU's to come out with on-board flash ROM
<Zarutian_HTC> oh? not pic16f877?
<tabemann> well, one of them
<tabemann> but yeah, the Cortex-M's, except for some which have ridiculous write page sizes, are better for Forth than the likes of the Atmega328p or most of the PIC's (the PIC32, which is really a MIPS, aside)
<Zarutian_HTC> I have mulled on if I could solve the ram issue with a very cheap sram spi chip
<tabemann> I'd expect SPI to come with a performance hit
<Zarutian_HTC> I am not targetting dsp speeds here
<tabemann> if money is no object, I'd just go with one of the Cortex-M4 or Cortex-M7 MCU's
<tabemann> those have plenty of RAM and plenty of flash
<Zarutian_HTC> I have looked at the cortex arm stuff and it is way too complex and expensive than what I have in mind
<tabemann> if money is an object, I'd go for the Cortex-M0+ chips; those are less capable than the Cortex-M4 or Cortex-M7 chips, but they still have a far nicer design than the Atmega328p
<Zarutian_HTC> cortex is usually meant for embedded linux or RTOS stuff
<tabemann> Cortex-M are microcontrollers; Cortex-A runs linux
<Zarutian_HTC> and the hardware interfacing I do not understand on cortex
<tabemann> Cortex-M chips may have MPU's but do not have traditional MMU's, so they can't run Linux
<Zarutian_HTC> embedded linux != linux
<tabemann> and Cortex-M0 and Cortex-M0+ are really lightweight chips; they're never going to run even, say, uClinux
<Zarutian_HTC> basically the former runs all processes in the same address space iirc
<tabemann> you mean uClinux
<Zarutian_HTC> most likely
<Zarutian_HTC> but it might be that the cortex datasheet is strangely organized regarding which device registers are where
<tabemann> uClinux targets Cortex-M3/M4/M7, not M0 or M0+
<Zarutian_HTC> my main issue is that if I go with one of the stms you mentioned, I have to order it from overseas and then wait for the shipping
<tabemann> and not with the Atmega328p?
<Zarutian_HTC> local reseller has it in bulk stock
<tabemann> that's why you buy in bulk (drives down the unit prices too); of course, it's expensive, and you have to be certain that you will be using the same MCU for all your projects from then out
<tabemann> I know tp from #Mecrisp has a massive stockpile of M0 chips because he did just that
<tabemann> (he has the same problem)
<Zarutian_HTC> and I can get the dip packaged ones out of the ardunio boards easily (might even use the ardunio board too)
<Zarutian_HTC> yebb, and I do not have the storage space or even the long term commitment
<tabemann> I know some companies provide free shipping
<tabemann> like tp uses arrow a lot IIRC because they'll ship to australia for free
<Zarutian_HTC> does arrow accept direct iban/swift payments or any of the cybercoins because I had it with credit card companies
<tabemann> dunno
<tabemann> I highly doubt you can pay arrow in bitcoin
<Zarutian_HTC> "oh the address on the card doesnt match the shipping address" "yes it does but your software does not know to handle char entities used" or other kind of shit like that
<tabemann> oh credit card companies not properly handling thorns, eths, and acute accents's gotta be a pain
* Zarutian_HTC nearly dislocated the shoulder of an toll flunky because the toll authority sat on my package for two weeks, he ended up paying the damn fees out of his own pocket
<tabemann> btw, you mean customs; "toll" in English means what you pay for using, say, a road, whereas its cognate in German, "Zoll", indeed means customs
<Zarutian_HTC> same thing
<tabemann> I'm gonna hit the sack (and it's later for you than it is for me!)
<Zarutian_HTC> cya
<tabemann> g'night
gravicappa has joined #forth
sts-q has quit [Ping timeout: 264 seconds]
sts-q has joined #forth
Zarutian_HTC has quit [Remote host closed the connection]
xek has joined #forth
dave0 has joined #forth
hosewiejacke has joined #forth
inode has joined #forth
travisb_ has joined #forth
pareidolia_ has joined #forth
djinni_ has joined #forth
koisoke_ has joined #forth
sts-q has quit [*.net *.split]
shmorgle has quit [*.net *.split]
djinni has quit [*.net *.split]
joe9 has quit [*.net *.split]
pareidolia has quit [*.net *.split]
irsol has quit [*.net *.split]
tabemann has quit [*.net *.split]
cmtptr has quit [*.net *.split]
Chobbes has quit [*.net *.split]
koisoke has quit [*.net *.split]
sts-q has joined #forth
X-Scale` has joined #forth
X-Scale has quit [Ping timeout: 240 seconds]
X-Scale` is now known as X-Scale
f-a has joined #forth
hosewiejacke has quit [Ping timeout: 272 seconds]
X-Scale` has joined #forth
X-Scale has quit [Ping timeout: 260 seconds]
X-Scale` is now known as X-Scale
f-a has quit [Quit: leaving]
f-a has joined #forth
hosewiejacke has joined #forth
elioat has joined #forth
f-a has quit [Read error: Connection reset by peer]
MrMobius has quit [Ping timeout: 265 seconds]
[1]MrMobius has joined #forth
f-a has joined #forth
lispmacs has joined #forth
f-a has quit [Quit: leaving]
elioat has quit [Quit: elioat]
elioat has joined #forth
f-a has joined #forth
elioat has quit [Quit: elioat]
elioat has joined #forth
scoofy has quit [Read error: Connection reset by peer]
user51 has joined #forth
user51 has left #forth [#forth]
dave0 has quit [Quit: dave's not here]
gravicappa has quit [Ping timeout: 240 seconds]
hosewiejacke has quit [Ping timeout: 256 seconds]
f-a has quit [Ping timeout: 256 seconds]
f-a has joined #forth
<lispmacs[work]> one of the first microcomputers was a 12 bit architecture: https://en.wikipedia.org/wiki/LINC
<f-a> mhhh I am going through jonesforth, sad that the, mhh, «reader/parser» thingo has to be complex
<f-a> I should start by implementing a 1-char forth :P
<elioat> there is a 1 instruction set machine, but I don't think it is more ismple :p https://github.com/howerj/subleq
<bjorkintosh> if a OISC is too complicated there're always ZISC
<f-a> no I mean, a forth where every word has length 1
<nihilazo> there is ZISC? what
<f-a> well it would not be a proper forth
<bjorkintosh> one instruction set computer: OISC. zero instruction set computer: ZISC.
<nihilazo> how does a ZISC work
<bjorkintosh> I have no idea.
<bjorkintosh> One, Two, Reduced, Complex.
<bjorkintosh> sorry. Zero, One, Two, Reduced, Complex. that's how you count instruction sets.
<bjorkintosh> Zero, One, Stack My forth. Two, Reduced, Rot my stack!
<bjorkintosh> Complex, ... something, something. it'll come to me.
<TangentDelta> A ZISC looks a lot like an FPGA
<TangentDelta> It's basically just a pipeline that data flows throw
<TangentDelta> *through
ecraven- has joined #forth
jn__ has quit [Quit: No Ping reply in 180 seconds.]
bjorkint0sh has joined #forth
djinni has joined #forth
actually1atman has joined #forth
djinni_ has quit [Quit: Leaving]
Vedran has quit [Quit: Ping timeout (120 seconds)]
travisb_ has quit [Remote host closed the connection]
Keshl_ has joined #forth
cantstanya has quit [Remote host closed the connection]
crest_ has joined #forth
spoofer_ has joined #forth
Vedran has joined #forth
<TangentDelta> My favorite OISC is a MOV machine with the PC in memory. It's not as mind-twisting to write programs for as SUBLEQ
<TangentDelta> It looks and feels like a simple microcode engine for a larger processor
bjorkintosh has quit [Remote host closed the connection]
TangentD1lta has joined #forth
TangentDelta has quit [Remote host closed the connection]
kiedtl has joined #forth
jyf has joined #forth
remexre_ has joined #forth
travisb has joined #forth
cp- has quit [Remote host closed the connection]
remexre has quit [Remote host closed the connection]
sts-q has quit [Ping timeout: 260 seconds]
elioat has quit [Ping timeout: 246 seconds]
cantstanya has joined #forth
a3f_ has joined #forth
jevinskie[m] has quit [Ping timeout: 240 seconds]
cheers- has joined #forth
cp- has joined #forth
koisoke_ has quit [Write error: Broken pipe]
Gromboli has quit [Quit: Ping timeout (120 seconds)]
actuallybatman has quit [Remote host closed the connection]
spoofer has quit [Remote host closed the connection]
rprimus has quit [Remote host closed the connection]
Keshl has quit [Remote host closed the connection]
yunfan has quit [Remote host closed the connection]
rprimus has joined #forth
koisoke has joined #forth
elioat has joined #forth
crest has quit [Remote host closed the connection]
inode has quit [Remote host closed the connection]
cheers has quit [Remote host closed the connection]
a3f has quit [Excess Flood]
ecraven has quit [Quit: bye]
ecraven- is now known as ecraven
kiedtl\0 has quit [Remote host closed the connection]
jn__ has joined #forth
patrickg has quit [Ping timeout: 265 seconds]
jimt[m] has quit [Ping timeout: 268 seconds]
siraben has quit [Ping timeout: 268 seconds]
sts-q has joined #forth
xek_ has joined #forth
xek has quit [Ping timeout: 256 seconds]
xek_ has quit [Quit: Leaving]
jevinskie[m] has joined #forth
jimt[m] has joined #forth
siraben has joined #forth
xek has joined #forth
_whitelogger has joined #forth
elioat has quit [Quit: elioat]
f-a has joined #forth
f-a has quit [Remote host closed the connection]
f-a has joined #forth
kiedtl has quit [Changing host]
kiedtl has joined #forth
kiedtl has joined #forth
kiedtl has quit [Changing host]
dave0 has joined #forth
KipIngram has quit [Quit: WeeChat 1.4]
KipIngram has joined #forth
KipIngram is now known as Guest34371
remexre_ is now known as remexre