From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=0.2 required=5.0 tests=DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 Received: (qmail 16550 invoked from network); 21 Oct 2022 00:05:24 -0000 Received: from 9front.inri.net (168.235.81.73) by inbox.vuxu.org with ESMTPUTF8; 21 Oct 2022 00:05:24 -0000 Received: from mail-io1-f48.google.com ([209.85.166.48]) by 9front; Thu Oct 20 20:04:05 -0400 2022 Received: by mail-io1-f48.google.com with SMTP id h203so1018120iof.1 for <9front@9front.org>; Thu, 20 Oct 2022 17:04:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=lNNkqQiU/SBp7Sl6BLBKFs1xdBNEzImKgG+GAm4JOCQ=; b=qTAdH87dIJz4rlf+CEMUdde8jFjblunzXWO6ZaSgOVyqF0YG2VgXbflDBUfpzRZEIN 1Nt24k9qPEhGeLQd9abIHQ36hsI7+4+q32wqMD/kaNZMfHcUXqX8FJ/eiahDEZg1s7A/ x8EHXRz6JgvY+lmH6USbsYi1sW8QdSfxbskpxQBt/F4ZQXMLWr9fHtD5chgamON4jAt4 e6JsDca9Rf/4arrmnTrRqEVwsbMDT7+oHcj8GejYe0nUfReZ1s+f3rD+1cEKFtHT9Hup 9RExzR7JCDRApUMbwaF4hdwIZiQgWimvmUk8kiPMVg1OZaQo2VBaLmehmE0bVQTSFaDd pO9g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=lNNkqQiU/SBp7Sl6BLBKFs1xdBNEzImKgG+GAm4JOCQ=; b=p7mgJF0O7AwbjviuaH6ufc2L5cdeaJsk9C0XdySQZJ7xryDeIYHxnWAwCdTPA/DxVJ uQOTb839hDRJ8JZJG2ys8oJbiszqm0hMGmrAbbciMIT4Jw2S8cPkjyQ42VWTqnsnU903 o8Vp3XDJhO0dkAD48BNFsV8WaZ5mN3yTpmiK+ywpmdlYl0y9HAu44w/C3IJd7iL0BDEP pcNeBRhp0olRVESW42CK+WluEDzYKLWUukxJgOIAVWBJXT9I420trVZ56ZyjGl71x2yP yDLCAiI9jkQ69tPhctSTmER62EpTY/oiYtTct3S6B4bcqii98nQjZwZYgPa9fppEYh/A ig+g== X-Gm-Message-State: ACrzQf1FM7Bn9m6ESjlZw9mZzvXvcEyhIZ9PEgEsArHpJsdOAdo9Ubrt gzsFduEvT0lMnfXVXCptmAwVxrvD/kd5hJGdq23XNDPEQM0= X-Google-Smtp-Source: AMsMyM6bRMM9oxB58vt3VVwfKItGiVUSYOXiGKBdhwSas8fNo9Z5D9brFZ+uz/T/Iti8AQbWoCzF95mxZf96En1JBG4= X-Received: by 2002:a05:6638:471b:b0:363:bb71:d82e with SMTP id cs27-20020a056638471b00b00363bb71d82emr13111301jab.141.1666310641543; Thu, 20 Oct 2022 17:04:01 -0700 (PDT) MIME-Version: 1.0 From: adventures in9 Date: Thu, 20 Oct 2022 17:03:50 -0700 Message-ID: To: 9front@9front.org Content-Type: text/plain; charset="UTF-8" List-ID: <9front.9front.org> List-Help: X-Glyph: ➈ X-Bullshit: non-blocking open-source content-driven table-aware app Subject: [9front] [PATCH] strchr.s for spim Reply-To: 9front@9front.org Precedence: bulk I finally found the time to get the kernel working for the Mediatek mt7688. Just the uart works now, so I still need to do the ethernet and hopefully wifi and other stuff. But it boots all the way to the bootargs ask, and then running !rc lets you run rc in paqfs. https://github.com/adventuresin9/9front-mt7688 I had a heck of a time getting it to work at first, till I tracked down an issue in strlen, that comes from the strchr code. Lots of stuff broke, and this bug also meant error messages wouldn't print properly. running this on the mt7688; int n1, n2, n3, n4, n5, n6; char *a1, *a2, *a3, *a4, *a5, *a6; a1 = "\0"; a2 = "A"; a3 = "AA"; a4 = "AAA"; a5 = "AAAA"; a6 = "AAAAA"; n1 = strlen(a1); n2 = strlen(a2); n3 = strlen(a3); n4 = strlen(a4); n5 = strlen(a5); n6 = strlen(a6); iprint("STRLEN %d %d %d %d %d %d\n", n1, n2, n3, n4, n5, n6); would get ; STRLEN 0 1 1 2 1 6 and now it gets; STRLEN 0 1 2 3 4 5 Also, to just get the world built for spim, /spim/include/ape, needs the files copied over from mips /sys/src/ape/lib/9/spim, also needs the files copied over from mips. This boots and runs on the last release, but when setting up an updated system to run diff for the patch, I found that Proc has been changed in a few ways that breaks it. ------- diff 2cd313668cea156fd13b54873d7934d9b15d8081 uncommitted --- a/sys/src/libc/spim/strchr.s +++ b/sys/src/libc/spim/strchr.s @@ -34,12 +34,12 @@ l4: MOVW (R3), R5 ADDU $4, R3 - AND R6,R5, R1 - AND R7,R5, R2 + AND $0xff,R5, R1 + AND $0xff00,R5, R2 BEQ R1, b0 - AND $0xff00,R5, R1 + AND R7,R5, R1 BEQ R2, b1 - AND $0xff,R5, R2 + AND R6,R5, R2 BEQ R1, b2 BNE R2, l4