Re: 80286 protected mode

Liste des GroupesRevenir à c arch 
Sujet : Re: 80286 protected mode
De : david.brown (at) *nospam* hesbynett.no (David Brown)
Groupes : comp.arch
Date : 16. Oct 2024, 18:57:03
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <veoupf$2b2ul$1@dont-email.me>
References : 1 2 3 4 5 6 7 8 9 10 11 12 13
User-Agent : Mozilla Thunderbird
(Please do not snip or omit attributions.  There are Usenet standards for a reason.)
On 16/10/2024 17:18, Stefan Monnier wrote:
There is an advantage to the C approach of separating out some
facilities and supplying them only in the standard library.
It goes a bit further: for a general purpose language, any existing
functionality that cannot be written using the language is a sign of
a weakness because it shows that despite being "general purpose" it
fails to cover this specific "purpose".
In an ideal world, it would be better if we could define `malloc` and
`memmove` efficiently in standard C, but at least they can be
implemented in non-standard C.
I don't see an advantage in being able to implement them in standard C.
 It means you can likely also implement a related yet different API
without having your code "demoted" to non-standard.
That makes no sense to me.  We are talking about implementing standard library functions.  If you want to implement other functions, go ahead.
Or do you mean that it is only possible to implement related functions (such as memory pools) if you also can implement malloc in fully portable standard C?  That would make a little more sense if it were true, but it is not.  First, you can implement such functions in implementation-specific code, so you are not hindered from writing the code you want.  Secondly, standard C provides functions such as malloc() and aligned_alloc() that give you the parts you need - the fact that you need something outside of standard C to implement malloc() does not imply that you need those same features to implement your additional functions.

E.g. say if your application wants to use a region/pool/zone-based
memory management.
 The fact that malloc can't be implemented in standard C is evidence
that standard C may not be general-purpose enough to accommodate an
application that wants to use a custom-designed allocator.
 
No, it is not - see above.
And remember how C was designed and how it was intended to be used.  The aim was to be able to write portable code that could be reused on many systems, and /also/ implementation, OS and target specific code for maximum efficiency, systems programming, and other non-portable work.  A typical C program combines these - some parts can be fully portable, other parts are partially portable (such as to any POSIX system, or targets with 32-bit int and 8-bit char), and some parts may be very compiler-specific or target specific.
That's not an indication of failure of C for general-purpose programming.  (But I would certainly not suggest that C is the best choice of language for many "general" programming tasks.)

I don't disagree with you, from a practical perspective:
 - in practice, C serves us well for Emacs's GC, even though that can't
   be written in standard C.
- it's not like there are lots of other languages out there that offer
   you portability together with the ability to define your own `malloc`.
 But it's still a weakness, just a fairly minor one.
 
The reason why you might want your own special memmove, or your own special
malloc, is that you are doing niche and specialised software.
 Region/pool/zone-based memory management is common enough that I would
not call it "niche", FWIW, and it's also used in applications that do want
portability (GCC and Apache come to mind).
Can't think of a practical reason to implement my own `memove`, OTOH.
           Stefan

Date Sujet#  Auteur
16 Apr 24 * Re: Whether something is RISC or not (Re: PDP-8 theology, not Concertina II Progress)237Lawrence D'Oliveiro
16 Apr 24 `* Re: Whether something is RISC or not (Re: PDP-8 theology, not Concertina II Progress)236David Brown
16 Apr 24  +- Re: Whether something is RISC or not (Re: PDP-8 theology, not Concertina II Progress)1MitchAlsup1
26 May 24  +- Re: Whether something is RISC or not (Re: PDP-8 theology, not Concertina II Progress)1MitchAlsup1
1 Oct 24  `* Re: Whether something is RISC or not (Re: PDP-8 theology, not Concertina II Progress)233MitchAlsup1
1 Oct 24   `* Re: Whether something is RISC or not (Re: PDP-8 theology, not Concertina II Progress)232Thomas Koenig
1 Oct 24    +* Re: Whether something is RISC or not (Re: PDP-8 theology, not Concertina II Progress)225MitchAlsup1
2 Oct 24    i+* Re: Whether something is RISC or not (Re: PDP-8 theology, not Concertina II Progress)223Brett
3 Oct 24    ii`* Re: Whether something is RISC or not (Re: PDP-8 theology, not Concertina II Progress)222Lawrence D'Oliveiro
3 Oct 24    ii +- Re: Whether something is RISC or not (Re: PDP-8 theology, not Concertina II Progress)1Brett
3 Oct 24    ii +- Re: Whether something is RISC or not (Re: PDP-8 theology, not Concertina II Progress)1Anton Ertl
3 Oct 24    ii `* Re: Whether something is RISC or not (Re: PDP-8 theology, not Concertina II Progress)219David Brown
3 Oct 24    ii  `* Byte ordering (was: Whether something is RISC or not)218Anton Ertl
3 Oct 24    ii   +- Re: Byte ordering (was: Whether something is RISC or not)1David Brown
4 Oct 24    ii   +* Re: Byte ordering (was: Whether something is RISC or not)215Lawrence D'Oliveiro
4 Oct 24    ii   i+- Re: Byte ordering1Lynn Wheeler
4 Oct 24    ii   i+* Re: Byte ordering (was: Whether something is RISC or not)211David Brown
4 Oct 24    ii   ii`* Re: Byte ordering (was: Whether something is RISC or not)210Anton Ertl
4 Oct 24    ii   ii +* Re: Byte ordering5BGB
5 Oct 24    ii   ii i`* Re: Byte ordering4MitchAlsup1
5 Oct 24    ii   ii i +* Re: Byte ordering2BGB
5 Oct 24    ii   ii i i`- Re: Byte ordering1Lawrence D'Oliveiro
5 Oct 24    ii   ii i `- Re: Byte ordering1Lawrence D'Oliveiro
5 Oct 24    ii   ii +* Re: Byte ordering (was: Whether something is RISC or not)13Lawrence D'Oliveiro
5 Oct 24    ii   ii i`* Re: Byte ordering (was: Whether something is RISC or not)12Brett
5 Oct 24    ii   ii i `* Re: Byte ordering (was: Whether something is RISC or not)11Anton Ertl
5 Oct 24    ii   ii i  `* Re: Byte ordering (was: Whether something is RISC or not)10Michael S
6 Oct 24    ii   ii i   +- Re: Byte ordering1Terje Mathisen
6 Oct 24    ii   ii i   `* Re: Byte ordering (was: Whether something is RISC or not)8Brett
7 Oct 24    ii   ii i    `* Re: Byte ordering (was: Whether something is RISC or not)7Lawrence D'Oliveiro
7 Oct 24    ii   ii i     `* Re: Byte ordering (was: Whether something is RISC or not)6Brett
7 Oct 24    ii   ii i      `* Re: Byte ordering (was: Whether something is RISC or not)5Michael S
7 Oct 24    ii   ii i       +* Re: Byte ordering2Stefan Monnier
7 Oct 24    ii   ii i       i`- Re: Byte ordering1Michael S
7 Oct 24    ii   ii i       `* Re: Byte ordering (was: Whether something is RISC or not)2Lawrence D'Oliveiro
8 Oct 24    ii   ii i        `- Re: Byte ordering1Terje Mathisen
6 Oct 24    ii   ii `* Re: Byte ordering191David Brown
6 Oct 24    ii   ii  `* Re: Byte ordering190Anton Ertl
6 Oct 24    ii   ii   `* Re: Byte ordering189John Dallman
7 Oct 24    ii   ii    +* Re: Byte ordering20Lawrence D'Oliveiro
8 Oct 24    ii   ii    i`* Re: Byte ordering19John Dallman
9 Oct 24    ii   ii    i +- VMS/NT memory management (was: Byte ordering)1Stefan Monnier
15 Oct 24    ii   ii    i +* Re: Byte ordering2Lawrence D'Oliveiro
15 Oct 24    ii   ii    i i`- Re: Byte ordering1MitchAlsup1
15 Oct 24    ii   ii    i `* Re: Byte ordering15Lawrence D'Oliveiro
15 Oct 24    ii   ii    i  +* Re: Byte ordering3Michael S
15 Oct 24    ii   ii    i  i+- Re: Byte ordering1John Dallman
18 Oct 24    ii   ii    i  i`- Re: Byte ordering1Lawrence D'Oliveiro
15 Oct 24    ii   ii    i  +* Re: Byte ordering9John Dallman
16 Oct 24    ii   ii    i  i+* Re: Byte ordering7George Neuner
16 Oct 24    ii   ii    i  ii`* Re: Byte ordering6Terje Mathisen
16 Oct 24    ii   ii    i  ii `* Re: Byte ordering5David Brown
17 Oct 24    ii   ii    i  ii  +* Re: Byte ordering2George Neuner
17 Oct 24    ii   ii    i  ii  i`- Re: Byte ordering1David Brown
17 Oct 24    ii   ii    i  ii  `* Re: clouds, not Byte ordering2John Levine
17 Oct 24    ii   ii    i  ii   `- Re: clouds, not Byte ordering1David Brown
18 Oct 24    ii   ii    i  i`- Re: Byte ordering1Lawrence D'Oliveiro
16 Oct 24    ii   ii    i  `* Re: Byte ordering2Paul A. Clayton
18 Oct 24    ii   ii    i   `- Re: Microkernels & Capabilities (was Re: Byte ordering)1Lawrence D'Oliveiro
7 Oct 24    ii   ii    `* 80286 protected mode168Anton Ertl
7 Oct 24    ii   ii     +* Re: 80286 protected mode5Lars Poulsen
7 Oct 24    ii   ii     i`* Re: 80286 protected mode4Terje Mathisen
7 Oct 24    ii   ii     i +- Re: 80286 protected mode1Michael S
7 Oct 24    ii   ii     i `* Re: 80286 protected mode2Lawrence D'Oliveiro
8 Oct 24    ii   ii     i  `- Re: 80286 protected mode1Terje Mathisen
7 Oct 24    ii   ii     +* Re: 80286 protected mode3Brett
7 Oct 24    ii   ii     i`* Re: 80286 protected mode2Michael S
7 Oct 24    ii   ii     i `- Re: 80286 protected mode1Brett
7 Oct 24    ii   ii     +- Re: 80286 protected mode1Lawrence D'Oliveiro
8 Oct 24    ii   ii     +* Re: 80286 protected mode152MitchAlsup1
8 Oct 24    ii   ii     i+* Re: 80286 protected mode4Lawrence D'Oliveiro
8 Oct 24    ii   ii     ii`* Re: 80286 protected mode3MitchAlsup1
9 Oct 24    ii   ii     ii +- Re: 80286 protected mode1David Brown
15 Oct 24    ii   ii     ii `- Re: 80286 protected mode1Lawrence D'Oliveiro
8 Oct 24    ii   ii     i`* Re: 80286 protected mode147Anton Ertl
8 Oct 24    ii   ii     i +- Re: 80286 protected mode1Robert Finch
9 Oct 24    ii   ii     i `* Re: 80286 protected mode145David Brown
9 Oct 24    ii   ii     i  +* Re: 80286 protected mode79MitchAlsup1
9 Oct 24    ii   ii     i  i`* Re: 80286 protected mode78David Brown
9 Oct 24    ii   ii     i  i `* Re: 80286 protected mode77Stephen Fuld
10 Oct 24    ii   ii     i  i  +* Re: 80286 protected mode2MitchAlsup1
10 Oct 24    ii   ii     i  i  i`- Re: 80286 protected mode1David Brown
10 Oct 24    ii   ii     i  i  +- Re: 80286 protected mode1David Brown
11 Oct 24    ii   ii     i  i  `* Re: 80286 protected mode73Tim Rentsch
15 Oct 24    ii   ii     i  i   `* Re: 80286 protected mode72Stefan Monnier
15 Oct 24    ii   ii     i  i    +* Re: 80286 protected mode30MitchAlsup1
16 Oct 24    ii   ii     i  i    i+* Re: 80286 protected mode25MitchAlsup1
16 Oct 24    ii   ii     i  i    ii+* Re: C and turtles, 80286 protected mode13John Levine
16 Oct 24    ii   ii     i  i    iii+* Re: C and turtles, 80286 protected mode7MitchAlsup1
16 Oct 24    ii   ii     i  i    iiii`* Re: C and turtles, 80286 protected mode6John Levine
17 Oct 24    ii   ii     i  i    iiii `* Re: C and turtles, 80286 protected mode5Thomas Koenig
20 Oct 24    ii   ii     i  i    iiii  `* Re: C and turtles, 80286 protected mode4Lawrence D'Oliveiro
20 Oct 24    ii   ii     i  i    iiii   `* Re: C and turtles, 80286 protected mode3George Neuner
22 Oct 24    ii   ii     i  i    iiii    `* Re: C and turtles, 80286 protected mode2Tim Rentsch
22 Oct 24    ii   ii     i  i    iiii     `- Re: C and turtles, 80286 protected mode1George Neuner
16 Oct 24    ii   ii     i  i    iii+- Re: C and turtles, 80286 protected mode1David Brown
16 Oct 24    ii   ii     i  i    iii`* Re: C and turtles, 80286 protected mode4Paul A. Clayton
17 Oct 24    ii   ii     i  i    iii +- Re: C and turtles, 80286 protected mode1David Brown
20 Oct 24    ii   ii     i  i    iii `* Re: C and turtles, 80286 protected mode2Lawrence D'Oliveiro
20 Oct 24    ii   ii     i  i    iii  `- Re: C and turtles, 80286 protected mode1Paul A. Clayton
16 Oct 24    ii   ii     i  i    ii+* Re: 80286 protected mode7Thomas Koenig
17 Oct 24    ii   ii     i  i    ii+* Re: 80286 protected mode3George Neuner
17 Oct 24    ii   ii     i  i    ii`- Re: 80286 protected mode1Tim Rentsch
16 Oct 24    ii   ii     i  i    i+* Re: 80286 protected mode3David Brown
17 Oct 24    ii   ii     i  i    i`- Re: 80286 protected mode1Tim Rentsch
16 Oct 24    ii   ii     i  i    `* Re: 80286 protected mode41David Brown
9 Oct 24    ii   ii     i  +* Re: 80286 protected mode51Thomas Koenig
13 Oct 24    ii   ii     i  `* Re: 80286 protected mode14Anton Ertl
8 Oct 24    ii   ii     `* Re: 80286 protected mode6John Levine
6 Oct 24    ii   i`* Re: Byte ordering (was: Whether something is RISC or not)2Michael S
4 Oct 24    ii   `- Re: Byte ordering (was: Whether something is RISC or not)1John Dallman
2 Oct 24    i`- Re: Whether something is RISC or not (Re: PDP-8 theology, not Concertina II Progress)1Thomas Koenig
2 Oct 24    +* Re: Whether something is RISC or not (Re: PDP-8 theology, not Concertina II Progress)5David Schultz
3 Oct 24    `- Re: Whether something is RISC or not (Re: PDP-8 theology, not Concertina II Progress)1Lawrence D'Oliveiro

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal