On 2018-04-25 16:39, Tom Ivar Helbekkmo<tih(a)hamartun.priv.no> wrote:
>
> Ron Natalie<ron(a)ronnatalie.com> writes:
>
>> RK05’s were 4872 blocks. Don’t know why that number has stuck with
>> me, too many invocations of mkfs I guess. Oddly, DEC software for
>> some reason never used the last 72 blocks.
> I guess that's because they implemented DEC Standard 144, known as
> bad144 in BSD Unix. It's a system of remapping bad sectors to spares at
> the end of the disk. I had fun implementing that for the wd (ST506)
> disk driver in NetBSD, once upon a time...
Uh... DEC STD 144 does not have anything to do with remapping bad blocks
to replacement good blocks. DEC STD 144 describes how a media stores
known bad blocks on a disk, so that file system initialization can then
take whatever action needed to that these blocks are not used by
anything. In RSX (and VMS), they will be included in a file called
BADBLK.SYS, and thus be perceived as "used".
bad144 in NetBSD will keep the a table in memory for such disks, and
"skip" blocks listed in the list as bad, meaning all other blocks gets
shifted. So it sortof do a remapping to good blocks by extending the
used blocks, and does not allocate anything at the end of the disk per
se. However, that is a Unix specific solution. OS/8 had a similar
solution for RL01 and RL02 drives, but not RK05 (as RK05 disks don't
follow DEC STD 144.)
I don't know exactly why DEC left the last three tracks unused. Might
have been for diagnostic tools to have a scratch area to play with.
Might have been that those tracks were found to be less reliable. Or
maybe something completely different. But it was not for bad block
replacement, as DEC didn't even do that on RK05 (or more or less in
general at all before MSCP. MSCP, by the way, does not use DEC STD 144.)
Something Unix and other implementations usually miss with DEC STD 144
is that there are actually two tables with bad blocks defined by the
standard. There is the manufacturer defined bad blocks, which all
software seems to know and deal with, and there are the user defined bad
blocks, which are supposed to be where all bad blocks that develop after
manufacture are supposed to be placed. Lots of software does not deal
with this second list. In addition, you also have the pack serial number
and some stuff defined by DEC STD 144, which is also recorded on the
last track, where the bad block lists also are stored.
Note that this information is supposed to be on the last track, meaning
you cannot use the scheme Unix uses to remap bad blocks, unless you keep
some blocks before the last track unallocated.
The ultimate irony was when I discovered that bad144 under NetBSD was
only built for x86 machine, and not being built for VAX, which is the
only architecture supported which actually have real disks which follow
the DEC STD 144. But that was corrected about 20 years ago now (time flies).
Johnny
--
Johnny Billquist || "I'm on a bus
|| on a psychedelic trip
email: bqt(a)softjar.se || Reading murder books
pdp is alive! || tryin' to stay hip" - B. Idol
> From: Johnny Billquist
> if you hadn't had the ability for them to be less than 8K, you wouldn't
> even try that argument.
Well, the 1972 edition of the -11/45 processor handbook called them segments.. :-)
I figure some marketing droid found out that 'paging' was the new buzzword, and
changed the name... :-) :-)
Noel
On 2018-04-26 00:55, jnc(a)mercury.lcs.mit.edu (Noel Chiappa) wrote:
> > From: Johnny Billquist
>
> > PDP-11 have 8K pages.
>
> Segments.:-) (This is an old argument between Johnny and me, I'm not trying
> to re-open it, just yanking his chain...:-)
:-)
And if you hadn't had the ability for them to be less than 8K, you
wouldn't even try that argument. But just because the hardware gives you
some extra capabilities, you suddenly want to associate them with a
technology that really gives you much less capabilities.
Either way, the next page always start at the next 8K boundary.
> > On a PDP-11, all your virtual memory was always there when the process
> > was on the CPU
>
> In theory, at least (I don't know of an OS that made use of this), didn't the
> memory management hardware allow the possibility to do demand-paging? I note
> that Access Control Field value 0 is "non-resident".
Oh yes. You definitely could do demand paging based on the hardware
capabilities.
> Unix kinda-sorta used this stuff, to automatically extend the stack when the
> user ran off the end of it (causing a trap).
Ah. Good point. The same is also true for brk, even though that is an
explicit request to grow your memory space at the other side.
DEC OSes had the brk part as well, but stack was not automatically
extended if needed. DEC liked to have the stack at the low end of
address space, and have hardware that trapped if the stack grew below
400 (octal).
> > you normally did not have demand paging, since that was not really
> > gaining you much on a PDP-11
>
> Especially on the later machines, with more than 256KB of hardware main
> memory. Maybe it might have been useful on the earlier ones (e.g. the -11/45).
Yeah, it would actually probably have been more useful on an 11/45.
Johnny
--
Johnny Billquist || "I'm on a bus
|| on a psychedelic trip
email: bqt(a)softjar.se || Reading murder books
pdp is alive! || tryin' to stay hip" - B. Idol
> From: Johnny Billquist
> PDP-11 have 8K pages.
Segments. :-) (This is an old argument between Johnny and me, I'm not trying
to re-open it, just yanking his chain... :-)
> On a PDP-11, all your virtual memory was always there when the process
> was on the CPU
In theory, at least (I don't know of an OS that made use of this), didn't the
memory management hardware allow the possibility to do demand-paging? I note
that Access Control Field value 0 is "non-resident".
Unix kinda-sorta used this stuff, to automatically extend the stack when the
user ran off the end of it (causing a trap).
> you normally did not have demand paging, since that was not really
> gaining you much on a PDP-11
Especially on the later machines, with more than 256KB of hardware main
memory. Maybe it might have been useful on the earlier ones (e.g. the -11/45).
Noel
On 2018-04-25 23:14, Paul Winalski <paul.winalski(a)gmail.com> wrote:
> On 4/25/18, Ronald Natalie
> <ron(a)ronnatalie.com> wrote:
>> The fun argument is what is Virtual Memory. Typically, people align that
>> with paging but you can stretch the definition to cover paging.
>> This was a point of contention in the early VAX Unix days as the ATT (System
>> III, even V?) didn’t support paging on the VAX where as BSD did.
> In my book, virtual memory is any addressing scheme where the
> addresses that the program uses are different from the physical memory
> addresses. Nowadays most OSes use a scheme where each process has its
> own virtual address space, and virtual memory is demand-paged from
> backing store on disk. But there have been other schemes.
Yeah...
> Some PDP-11 models had a virtual addressing feature called PLAS
> (Program Logical Address Space). The PDP-11 had 16-bit addressing,
> allowing for at most 64K per process. To take advantage of physical
> memory larger than 64K, PLAS allowed multiple 64K virtual address
> spaces to be mapped to the larger physical memory. Sort of the
> reverse of the usual virtual addressing scheme, where there is more
> virtual memory than physical memory.
Note that PLAS is not a PDP-11 hardware thing. PLAS was the name for the
mechanism provided by the OS for applications to be able to access more
than 64K of memory while still be limited by the virtual address space
limit of 64K.
PLAS is in one way very similar to mmap, except that it's not backed by
a file. But you create a memory region though the OS (giving it a name
and a size, which can be more than 64K), and then you can map to it,
specifying the offset into it and window size, as well as where to map
to in your virtual address space.
This is realized by just using the pages of the MMU of the PDP-11 map to
different parts and things.
Any OS that had the PLAS capability by necessity had to have an MMU,
which was the hardware part that allowed this to be implemented.
So, all PDP-11s with an MMU could allow the OS running on it to provide
the PLAS capabilities.
A PDP-11 in general is "reversed" in that the physical address space is
much larger than the virtual one. Although, the same was also true on
the VAX in the last iteration where the NVAX implementation allowed for
a 34 bit physical address, while the virtual address space was still
only 32 bits.
But that doesn't make the virtual memory any less virtual.
Johnny
--
Johnny Billquist || "I'm on a bus
|| on a psychedelic trip
email: bqt(a)softjar.se || Reading murder books
pdp is alive! || tryin' to stay hip" - B. Idol
> From: Johnny Billquist
> I don't know exactly why DEC left the last three tracks unused. Might
> have been for diagnostic tools to have a scratch area to play with.
> Might have been that those tracks were found to be less reliable. Or
> maybe something completely different. But it was not for bad block
> replacement, as DEC didn't even do that on RK05
The "pdp11 peripherals handbook" (1975 edition at least, I can't be bothered
to check them all) says, for the RK11:
"Tracks/surface: 200+3 spare"
and for the RP11:
"Tracks/surface: 400 (plus 6 spares)"
which sounds like it could be for bad block replacement, but the RP11-C
Maintenance Manual says (pg. 3-10) "the inner-most cylinders 400-405 are only
used for maintenance".
Unix blithely ignored all that, and used every block available on both the
RK11 and RP11.
Noel
On 2018-04-25 16:39, arnold(a)skeeve.com wrote:
> Tim Bradshaw<tfb(a)tfeb.org> wrote:
>
>> Do systems with huge pages page in the move-them-to-disk sense I wonder?
>> I assume they don't in practice because it would be insane but I wonder
>> if the VM system is in theory even willing to try.
> Why not? If there's enough backing store availble?
>
> Note that many systems demand page-in the code section straight out of the
> executable, so if some of those pages aren't needed, they can just
> be released. And said pages can be shared among all processes running
> the same executable, for further savings.
Right.
>> Something I never completely understood in the paging vs swapping
>> thing was that I think that systems which could page (well, 4.xBSD in
>> particular) would*also* swap if pushed. I think the reason for that was
>> that, if you were really short of memory, swapping freed up the process
>> structure and also the page tables &c for the process, which would still
>> be needed even if all its pages had been evicted. Is that right?
> It depends upon the system. Some had pageable page tables, which is
> pretty hairy. Others didn't. I don't remember what 4BSD did on the
> Vax, but I suspect that the page tables and enough info to find everything
> on swap stayed in kernel memory. (Where's Chris Torek when you need
> him?:-)
The pages tables describing the users memory space are themselves
located in virtual memory on the VAX, so they can be paged out without
problem. If you refer to an entry in the user page table, and that page
itself is paged out, you'll get a page fault for the system page table,
so you'll need to page in that page of the system.
But I seem to remember 4BSD (as well as NetBSD) keep all of the kernel
in physical memory all the time, and don't page the kernel parts,
including process page tables.
> But yes, swapping was generally used to free up large amounts of memory
> if under heavy load.
Paging would free up the same amount of memory, if we talk about the
memory used by the process itself. However, there are various meta data
in the kernel itself that is needed for a process, which will remain in
memory even if no pages are in memory. Swapping will also move
non-essential kernel structures out to disk for the process, in addition
to the pages. Thus, there is a difference between swapping and paging.
The whole process context for example. Which includes both the page
tables as well as the kernel mode stack for the process, processor
registers, and possibly also open file contexts, and probably some other
things I'm forgetting now.
Very little needs to be kept in memory for a process if you are not
interested in resuming it on short notice.
Johnny
--
Johnny Billquist || "I'm on a bus
|| on a psychedelic trip
email: bqt(a)softjar.se || Reading murder books
pdp is alive! || tryin' to stay hip" - B. Idol
I came across this yesterday:
> Fun fact: according to unsubstantiated UNIX lore, "rm" is NOT short-hand
> for "remove" but rather, it stands for the initials of the developer that wrote
> the original implementation, Robert Morris.
>
> https://news.ycombinator.com/item?id=16916565
I was curious if there's any truth to it. I found
http://minnie.tuhs.org/cgi-bin/utree.pl and was poking around but
couldn't determine when the rm command came about.
Thoughts?
--
Eric Blood
winkywooster(a)gmail.com
On 2018-04-25 16:39, Ronald Natalie<ron(a)ronnatalie.com> wrote:
>
>> On Apr 24, 2018, at 9:27 PM, Dan Stromberg<drsalists(a)gmail.com> wrote:
>>
>> On Sun, Apr 22, 2018 at 2:51 PM, Dave Horsfall<dave(a)horsfall.org> wrote:
>>> Now, how many youngsters know the difference between paging and swapping?
>> I'm a mere 52, but I believe paging is preferred over swapping.
>>
>> Swapping is an entire process at a time.
>>
>> Paging is just a page of memory at a time - like 4K or something thereabout.
> Early pages were 1K.
What machines are we talking about then?
PDP-11 have 8K pages. VAX have 512 byte pages, if we talk about hardware.
(And yes, I know pages on PDP-11s are not fixed in size, but if you want
the page to go right up to the next page, it's 8K.)
> The fun argument is what is Virtual Memory. Typically, people align that with paging but you can stretch the definition to cover paging.
> This was a point of contention in the early VAX Unix days as the ATT (System III, even V?) didn’t support paging on the VAX where as BSD did.
> Our comment was that “It ain’t VIRTUAL memory if it isn’t all there” as opposed to virtual addressing.
Weird comment. What does that mean? On a PDP-11, all your virtual memory
was always there when the process was on the CPU, but it might not be
there at other times. Just as not all processes memory would be in
physical memory all the time, since that often would require more
physical memory than you had.
But you normally did not have demand paging, since that was not really
gaining you much on a PDP-11. On the other hand, overlays do the same
thing for you, but in userspace.
So you would claim that ATT Unix did not have virtual memory because it
didn't do demand paging?
Johnny
--
Johnny Billquist || "I'm on a bus
|| on a psychedelic trip
email: bqt(a)softjar.se || Reading murder books
pdp is alive! || tryin' to stay hip" - B. Idol
Fake news knocks on the doors of Unixland: there's absolutely
no truth to the claim that the rm command was written by
Robert Morris. Rm was there from the beginning, when only
two people wrote Unix code--Thompson and Ritchie. In fact,
it would have been on PDP8 Unix, which Morris never used.
Doug