we have to call tmpmap() with interrupts disabled as the map
is a per cpu and a interrupt can preempt us while we where
commited to use a entry but *before* we wrote it!
tmpunmap() already calls coherence() before flushpg() so it
is not needed after tmpunmap().
splhi() in l2free() isnt needed as l2free() is always called
with interrupts disabled from mmuswitch() and mmurelease().
fpsave needs to disable the fpu! otherwise we won't catch
the mathtrap() in the kernel or when context switching to
another process that will attempt to use it.
intrdisable() will always be able to unregister the interrupt
now, so there is no reason to have it return an error value.
all drivers except uart8250 already assumed it to never fail
and theres no need to maintain that complexity.
other operating systems always set the "don't fragment" bit
in ther outgoing ipv4 packets causing us to unnecesarily
call ip4reassemble() looking for a fragment reassembly queue.
the change excludes the "don't fragment" bit from the test
so we now call ip4reassemble() only when the "more fragmens"
bit is set or a fragment offset other than zero is given.
this optimization was discovered from akaros.
to allow bytewise access to /proc/#/fd, the contents of the file where
recreated on each call. if fd's had been closed or reassigned between
the reads, the offset would be inconsistent and a read could start off
in the middle of a line. this happens when you cat /proc/#/fd file of
a busy process that mutates its filedescriptor table.
to fix this, we now return one line record at a time. if the line
fits in the read size, then this means the next read will always start
at the beginning of the next line record. we remember the consumed
byte count in Chan.mrock and the current record in Chan.nrock. (these
fields are free to usefor non-directory files)
if a read comes in and the offset is the same as c->mrock, we do not
need to regenerate the file and just render the next c->nrock's record.
for reads smaller than the line count, we have to regenerate the content
up to the offset and the race is still possible, but this should not
be the common case.
the same algorithm is now used for /proc/#/ns file, allowing a simpler
reimplementation and getting rid of Mntwalk state strcture.
mpshutdown() used to call acpireset() making it impossible to build
a kernel without archacpi. now, mpshutdown() is a helper function
that only shuts down the application processors that gets used from
mpreset() and acpireset().
the generic machine reset code in exported by devarch's archreset()
function that is called by mpreset() and from acpireset() as a fallback.
so the code duplication that was in mpshutdown() is avoided.
the purpose of checkpages() is to verify consitency of the hardware mmu state,
not to notify on the console that a program faulted. a program could also
continue after handling the note. (this seems to be the case in go programs)
- shorten cpuidprnt so it doesnt have to break line
- addarchfile: complain when running out of entries
- fix range check in rmemrw() (harmless)
- use nil instead of 0 for pointers
- in 9front, the bootargs are in the form: method!device args
- remove redundant and wrong paragraphs regarding tcp booting
- document il boot method
- fix boot and bootrc confusions
this is a new more simple version of the mount cache
that does not require dynamic allocations for extends.
the Mntcache structure now contains a page bitmap
that is used for quick page invalidation. the size
of the bitmap is proportional to MAXCACHE.
instead of keeping track of cached range in the
Extend data structure, we keep all the information
in the Page itself. the offset from the page where
the cache range starts is in the low PGSHIT bits and
the end in the top bits of Page.va.
we choose Page.daddr to map 1:1 the Mountcache number
and page number (pn) in the Mountcache. to find a page,
we first check the bitmap if the page is there and then
do a pagelookup() with the daddr key.
change page cache ids (bid) to uintptr so we use the full
address space of Page.daddr.
make maxcache offset check consistent in cread().
use consistent types in cupdate() and simplify with goto.
make internal functions static.
use nil instead of 0 for pointers.
there is no use for "bootdisk" variable parametrization
of /boot/boot and no point for the boot section with its
boot methods in the kernel configuration anymore. so
mkboot and boot$CONF.out are gone.
move the rules for bootfs.paq creation in 9/boot/bootmkfile.
location of bootfs.proto is now in 9/boot/bootfs.proto.
our /boot/boot target is now just "boot".
expand the list of files specified in bootfs.proto and use them
as dependencies to bootfs.paq rule. this way, bootfs.paq is
regenerated when the to be included files have been modified.
the utf8 buffers b1 where allocated from fbufalloc() which gives
us BUFSIZE bytes, but Xfid->count can be bigger than that. so just
emalloc() the requested number of bytes.
when converting from Runes to utf-8, we have to account for the
terminating '\0' byte snprint() places, so fix the maxrune number
calculation instead of using BUFSIZE+1 as buffer size.
A buffer can be overflowed in the init function of kbmap.c by using a filename of more than 112 characters.
sample output:
% cd /sys/lib/kbmap
% touch aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
% kbmap
kbmap 1974: suicide: sys: trap: fault write addr=0xa6a96510 pc=0x000011df
offending code is most likely the call to sprint in the init function of /sys/src/cmd/kbmap.c,
which in this case writes /sys/lib/kbmap/$file to a 128-bit buffer.
I'm willing to submit a patch for this myself along with a few minor improvements/fixes to kbmap
if I can figure out the nuances of doing so.
--silasm
factotum is started in bootrc before the network is setup
(as we need it to negotiate wpa key for wifi). once, the network
is setup, the bootstrap authservers are passed in /net/ndb,
which factotum reads when doing bootstrap authdial. it does
this only when no authserver was specified earlier! but we
want net.rc to select the proper bootstrap authserver...
the $secstore variable takes precedence over $auth. as
there is no connection server yet, we have to select the set
of servers here and pass them to secstore with -s flag.
note that this will work if multiple addresses where
specified.
bug: Rnointerrupt was used on Vqueue.used.flags instead of
Vqueue.avail.flags.
introduce vqnotify() function that notifies the device
about available ring advancement.
avoid queue notifications there that can be slow by
checking Unonotify flag in Vqueue.used.flags.
keep track of the number of notifications in the queue.
- properly negotiate Fctrlrx feature bit for promisc and multicast.
- allow setting mac address with ea= option from plan9.ini
- dont read the isr register from ifstats() as it has the side effect of reseting isr status
- embedd the Vqueue array in the Ctlr structure avoiding indirection
- add a interrupt counter Vqueue.nintr for statistical purposes
- only read network status register if the feature has been negotiated
- change name to "virtio" as "ethervirtio" is kind of redundant
continue recursing when we get empty but non-negative answer
from a (claimed) authoritative nameserer that provides more
nameservers.
this fixes wordpress dns:
63766.3: sending to 192.0.80.93/ns1.wordpress.com bossypally.files.wordpress.com ip
63766: rcvd OK from 192.0.80.93 (authoritative)
Q: bossypally.files.wordpress.com ip
Auth: files.wordpress.com 5 min ns mdns1.wordpress.com
files.wordpress.com 5 min ns mdns2.wordpress.com
files.wordpress.com 5 min ns mdns3.wordpress.com
files.wordpress.com 5 min ns mdns4.wordpress.com
files.wordpress.com 5 min ns mdns5.wordpress.com
Hint: mdns1.wordpress.com 4 hr ip 192.0.75.7
mdns2.wordpress.com 4 hr ip 198.181.117.7
mdns3.wordpress.com 4 hr ip 198.181.116.7
mdns4.wordpress.com 4 hr ip 198.181.118.7
mdns5.wordpress.com 4 hr ip 192.0.74.7
63766.4: sending to 192.0.75.7/mdns1.wordpress.com bossypally.files.wordpress.com ip
63766: rcvd OK from 192.0.75.7 (authoritative)
Q: bossypally.files.wordpress.com ip
Ans: bossypally.files.wordpress.com 5 min ip 192.0.72.2
bossypally.files.wordpress.com 5 min ip 192.0.72.3
----------------------------
answer bossypally.files.wordpress.com 5 min ip 192.0.72.2
answer bossypally.files.wordpress.com 5 min ip 192.0.72.3
----------------------------
note the authoritative flag in the first response from ns1.wordpress.com that
would otherwise terminate the search.
add vctlcmd() function to setup and comlete control commands.
handle Vctlq and implement promiscuous and multicast mode commands.
remove Vqueue.block[] and Vqueue.header. these are not properties
of the queue (Vctlq as no block array).
the block[] array only needs to be half the queue size as we use
two descriptors per packet.
fix broken shutdown() and remove useless ctl() function.
when we hit a conflict where the pci INTL register gives us
a different irq than we get from southbridge irq router, dont
just change the router setting to the bios assigned irq (that
was previously known as the BIOS workarround), but assume the
southbridge setting to be valid and change the pci INTL register
on the device to it.
only when the router link doesnt seem to be configured or
disabled, then program the router to the irq that bios asisgned
in the INTL register.
the reason is that changing the router setting changes the
irq routing for *all* devices on the same link and changing
it breaks previously checked and valid interrupt routings.
(so happend with virtualbox where the last device on the bus
is some powermanagement device that has wrong INTL setting
and changing the routing breaks the ethernet interrupts)
this change shouldnt affect modern machines which use ioapic
and mp tables or acpi for pci interrupt routing.
we add new function convmemsize() that returns the size of
*usable* conventional memory that does some sanity checking
and reserves the last KB below the top of memory pointer.
this avoids lowraminit() overriding potential bios tables
and sigsearch() going off the rails looking for tables
at above 640K.
the x200s is too slow on a single core to keep up without
audio buffer underruns, so the idea is to flush screen
in parallel to witing audio samples in a separate process.
with the proc, we also can keep updating the screen on resize
when paused.
Based on OpenBSD driver:
- /sys/dev/pci/azalia.c rev 1.209
- /sys/dev/pci/pcidevs rev 1.1689
- only tested on amd64; machine is an Acer V5-573G
exact model: V5-573G-74518G1Takk
sed just continued writing past genbuf when it should stop
with "Output line too long".
quit when we get unspecified options.
stupid casts from long to char* for no reason.
some 0 vs nil cleanup.
traditionally, the pc kernel mapped the first 8MB of physical
address space. when the kernel size grows beyond that memory mapping,
it will crash on boot and theres no checking in the build process
making sure it fits.
with the pc64 kernel, it is not hard to always map the whole
kernel memory image from KZERO to end[], so that the kernel will
always fit into the initial mapping.
we can improve performance alot by using webfs which
does http keep alives for us, so connection setup
overhead is eleminated.
fix 9p flushes and double frees.
we can avoid some flickering when removing the software cursor
from the shadow framebuffer by avoiding the flushscreenimage()
call.
once the cursor is redrawn, we flush the combined rect of its
old and new position in one go.