Merge ^/head r312894 through r312967.
This commit is contained in:
commit
d412f6faf3
5
Makefile
5
Makefile
@ -236,7 +236,7 @@ _MAKE+= MK_META_MODE=no
|
||||
|
||||
# Guess machine architecture from machine type, and vice versa.
|
||||
.if !defined(TARGET_ARCH) && defined(TARGET)
|
||||
_TARGET_ARCH= ${TARGET:S/pc98/i386/:S/arm64/aarch64/}
|
||||
_TARGET_ARCH= ${TARGET:S/arm64/aarch64/}
|
||||
.elif !defined(TARGET) && defined(TARGET_ARCH) && \
|
||||
${TARGET_ARCH} != ${MACHINE_ARCH}
|
||||
_TARGET= ${TARGET_ARCH:C/mips(n32|64)?(el)?(hf)?/mips/:C/arm(v6)?(eb)?/arm/:C/aarch64/arm64/:C/powerpc64/powerpc/:C/powerpcspe/powerpc/:C/riscv64(sf)?/riscv/}
|
||||
@ -417,13 +417,12 @@ worlds: .PHONY
|
||||
# existing system is.
|
||||
#
|
||||
.if make(universe) || make(universe_kernels) || make(tinderbox) || make(targets)
|
||||
TARGETS?=amd64 arm arm64 i386 mips pc98 powerpc sparc64
|
||||
TARGETS?=amd64 arm arm64 i386 mips powerpc sparc64
|
||||
_UNIVERSE_TARGETS= ${TARGETS}
|
||||
TARGET_ARCHES_arm?= arm armeb armv6
|
||||
TARGET_ARCHES_arm64?= aarch64
|
||||
TARGET_ARCHES_mips?= mipsel mips mips64el mips64 mipsn32 mipselhf mipshf mips64elhf mips64hf
|
||||
TARGET_ARCHES_powerpc?= powerpc powerpc64 powerpcspe
|
||||
TARGET_ARCHES_pc98?= i386
|
||||
.for target in ${TARGETS}
|
||||
TARGET_ARCHES_${target}?= ${target}
|
||||
.endfor
|
||||
|
@ -349,7 +349,6 @@ KNOWN_ARCHES?= aarch64/arm64 \
|
||||
armeb/arm \
|
||||
armv6/arm \
|
||||
i386 \
|
||||
i386/pc98 \
|
||||
mips \
|
||||
mipsel/mips \
|
||||
mips64el/mips \
|
||||
|
@ -151,6 +151,19 @@ OLD_FILES+=usr/lib/clang/3.9.1/lib/freebsd/libclang_rt.ubsan_standalone_cxx-x86_
|
||||
OLD_DIRS+=usr/lib/clang/3.9.1/lib/freebsd
|
||||
OLD_DIRS+=usr/lib/clang/3.9.1/lib
|
||||
OLD_DIRS+=usr/lib/clang/3.9.1
|
||||
# 20170128: remove pc98 support
|
||||
OLD_FILES+=usr/include/dev/ic/i8251.h
|
||||
OLD_FILES+=usr/include/dev/ic/i8255.h
|
||||
OLD_FILES+=usr/include/dev/ic/rsa.h
|
||||
OLD_FILES+=usr/include/dev/ic/wd33c93reg.h
|
||||
OLD_FILES+=usr/include/sys/disk/pc98.h
|
||||
OLD_FILES+=usr/include/sys/diskpc98.h
|
||||
OLD_FILES+=usr/share/man/man4/i386/ct.4.gz
|
||||
OLD_FILES+=usr/share/man/man4/i386/snc.4.gz
|
||||
OLD_FILES+=usr/share/syscons/keymaps/jp.pc98.iso.kbd
|
||||
OLD_FILES+=usr/share/syscons/keymaps/jp.pc98.kbd
|
||||
OLD_FILES+=usr/share/vt/keymaps/jp.pc98.iso.kbd
|
||||
OLD_FILES+=usr/share/vt/keymaps/jp.pc98.kbd
|
||||
# 20170110: Four files from ggate tests consolidated into one
|
||||
OLD_FILES+=usr/tests/sys/geom/class/gate/1_test
|
||||
OLD_FILES+=usr/tests/sys/geom/class/gate/2_test
|
||||
|
@ -15156,6 +15156,7 @@ static const struct mips_cpu_info mips_cpu_info_table[] =
|
||||
|
||||
/* Cavium Networks Octeon CPU core */
|
||||
{ "octeon", 0, ISA_MIPS64R2, CPU_OCTEON },
|
||||
{ "octeon+", 0, ISA_MIPS64R2, CPU_OCTEON },
|
||||
|
||||
/* End marker */
|
||||
{ NULL, 0, 0, 0 }
|
||||
|
@ -765,6 +765,7 @@ const struct mips_cpu_info mips_cpu_info_table[] = {
|
||||
|
||||
/* MIPS64R2 */
|
||||
{ "octeon", PROCESSOR_OCTEON, 65 },
|
||||
{ "octeon+", PROCESSOR_OCTEON, 65 },
|
||||
|
||||
/* End marker */
|
||||
{ 0, 0, 0 }
|
||||
|
@ -285,7 +285,10 @@ extern const struct mips_rtx_cost_data *mips_cost;
|
||||
\
|
||||
macro = concat ((PREFIX), "_", (INFO)->name, NULL); \
|
||||
for (p = macro; *p != 0; p++) \
|
||||
*p = TOUPPER (*p); \
|
||||
if (*p == '+') \
|
||||
*p = 'P'; \
|
||||
else \
|
||||
*p = TOUPPER (*p); \
|
||||
\
|
||||
builtin_define (macro); \
|
||||
builtin_define_with_value ((PREFIX), (INFO)->name, 1); \
|
||||
|
@ -1,49 +0,0 @@
|
||||
#
|
||||
# $FreeBSD$
|
||||
# @(#)ttys 5.1 (Berkeley) 4/17/89
|
||||
#
|
||||
# This file specifies various information about terminals on the system.
|
||||
# It is used by several different programs. Common entries for the
|
||||
# various columns include:
|
||||
#
|
||||
# name The name of the terminal device.
|
||||
#
|
||||
# getty The program to start running on the terminal. Typically a
|
||||
# getty program, as the name implies. Other common entries
|
||||
# include none, when no getty is needed, and xdm, to start the
|
||||
# X Window System.
|
||||
#
|
||||
# type The initial terminal type for this port. For hardwired
|
||||
# terminal lines, this will contain the type of terminal used.
|
||||
# For virtual consoles, the correct type is typically cons25w.
|
||||
# Other common values include dialup for incoming modem ports, and
|
||||
# unknown when the terminal type cannot be predetermined.
|
||||
#
|
||||
# status Must be on or off. If on, init will run the getty program on
|
||||
# the specified port. If the word "secure" appears, this tty
|
||||
# allows root login.
|
||||
#
|
||||
# name getty type status comments
|
||||
#
|
||||
# If console is marked "insecure", then init will ask for the root password
|
||||
# when going to single-user mode.
|
||||
console none unknown off secure
|
||||
#
|
||||
ttyv0 "/usr/libexec/getty Pc" cons25w on secure
|
||||
# Virtual terminals
|
||||
ttyv1 "/usr/libexec/getty Pc" cons25w on secure
|
||||
ttyv2 "/usr/libexec/getty Pc" cons25w on secure
|
||||
ttyv3 "/usr/libexec/getty Pc" cons25w on secure
|
||||
ttyv4 "/usr/libexec/getty Pc" cons25w on secure
|
||||
ttyv5 "/usr/libexec/getty Pc" cons25w on secure
|
||||
ttyv6 "/usr/libexec/getty Pc" cons25w on secure
|
||||
ttyv7 "/usr/libexec/getty Pc" cons25w on secure
|
||||
ttyv8 "/usr/local/bin/xdm -nodaemon" xterm off secure
|
||||
# Serial terminals
|
||||
# The 'dialup' keyword identifies dialin lines to login, fingerd etc.
|
||||
ttyu0 "/usr/libexec/getty 3wire" vt100 onifconsole secure
|
||||
ttyu1 "/usr/libexec/getty 3wire" vt100 onifconsole secure
|
||||
ttyu2 "/usr/libexec/getty 3wire" vt100 onifconsole secure
|
||||
ttyu3 "/usr/libexec/getty 3wire" vt100 onifconsole secure
|
||||
# Dumb console
|
||||
dcons "/usr/libexec/getty std.9600" vt100 off secure
|
@ -112,7 +112,6 @@ icelandic.iso) echo is;;
|
||||
it.iso) echo it;;
|
||||
jp.106x) echo jp.capsctrl;;
|
||||
jp.106) echo jp;;
|
||||
#?? jp.pc98.iso) echo jp.pc98;;
|
||||
kk.pt154.io) echo kz.io;;
|
||||
kk.pt154.kst) echo kz.kst;;
|
||||
latinamerican.iso.acc) echo latinamerican.acc;;
|
||||
|
@ -43,6 +43,8 @@
|
||||
#include <sys/cdefs.h>
|
||||
#include <sys/_types.h>
|
||||
|
||||
__NULLABILITY_PRAGMA_PUSH
|
||||
|
||||
__BEGIN_DECLS
|
||||
void err(int, const char *, ...) __dead2 __printf0like(2, 3);
|
||||
void verr(int, const char *, __va_list) __dead2 __printf0like(2, 0);
|
||||
@ -58,7 +60,8 @@ void vwarnc(int, const char *, __va_list) __printf0like(2, 0);
|
||||
void warnx(const char *, ...) __printflike(1, 2);
|
||||
void vwarnx(const char *, __va_list) __printflike(1, 0);
|
||||
void err_set_file(void *);
|
||||
void err_set_exit(void (*)(int));
|
||||
void err_set_exit(void (* _Nullable)(int));
|
||||
__END_DECLS
|
||||
__NULLABILITY_PRAGMA_POP
|
||||
|
||||
#endif /* !_ERR_H_ */
|
||||
|
@ -46,6 +46,8 @@
|
||||
#include <sched.h>
|
||||
#include <time.h>
|
||||
|
||||
__NULLABILITY_PRAGMA_PUSH
|
||||
|
||||
/*
|
||||
* Run-time invariant values:
|
||||
*/
|
||||
@ -147,28 +149,35 @@ struct _pthread_cleanup_info {
|
||||
*/
|
||||
__BEGIN_DECLS
|
||||
int pthread_atfork(void (*)(void), void (*)(void), void (*)(void));
|
||||
int pthread_attr_destroy(pthread_attr_t *);
|
||||
int pthread_attr_getstack(const pthread_attr_t * __restrict,
|
||||
void ** __restrict, size_t * __restrict);
|
||||
int pthread_attr_getstacksize(const pthread_attr_t *, size_t *);
|
||||
int pthread_attr_getguardsize(const pthread_attr_t *, size_t *);
|
||||
int pthread_attr_destroy(pthread_attr_t * _Nonnull);
|
||||
int pthread_attr_getstack(
|
||||
const pthread_attr_t * _Nonnull __restrict,
|
||||
void ** _Nonnull __restrict,
|
||||
size_t * _Nonnull __restrict);
|
||||
int pthread_attr_getstacksize(const pthread_attr_t * _Nonnull,
|
||||
size_t * _Nonnull);
|
||||
int pthread_attr_getguardsize(const pthread_attr_t * _Nonnull,
|
||||
size_t * _Nonnull);
|
||||
int pthread_attr_getstackaddr(const pthread_attr_t *, void **);
|
||||
int pthread_attr_getdetachstate(const pthread_attr_t *, int *);
|
||||
int pthread_attr_init(pthread_attr_t *);
|
||||
int pthread_attr_setstacksize(pthread_attr_t *, size_t);
|
||||
int pthread_attr_setguardsize(pthread_attr_t *, size_t);
|
||||
int pthread_attr_setstack(pthread_attr_t *, void *, size_t);
|
||||
int pthread_attr_getdetachstate(const pthread_attr_t * _Nonnull,
|
||||
int * _Nonnull);
|
||||
int pthread_attr_init(pthread_attr_t * _Nonnull);
|
||||
int pthread_attr_setstacksize(pthread_attr_t * _Nonnull, size_t);
|
||||
int pthread_attr_setguardsize(pthread_attr_t * _Nonnull, size_t);
|
||||
int pthread_attr_setstack(pthread_attr_t * _Nonnull, void *,
|
||||
size_t);
|
||||
int pthread_attr_setstackaddr(pthread_attr_t *, void *);
|
||||
int pthread_attr_setdetachstate(pthread_attr_t *, int);
|
||||
int pthread_barrier_destroy(pthread_barrier_t *);
|
||||
int pthread_barrier_init(pthread_barrier_t *,
|
||||
int pthread_attr_setdetachstate(pthread_attr_t * _Nonnull, int);
|
||||
int pthread_barrier_destroy(pthread_barrier_t * _Nonnull);
|
||||
int pthread_barrier_init(pthread_barrier_t * _Nonnull,
|
||||
const pthread_barrierattr_t *, unsigned);
|
||||
int pthread_barrier_wait(pthread_barrier_t *);
|
||||
int pthread_barrierattr_destroy(pthread_barrierattr_t *);
|
||||
int pthread_barrierattr_getpshared(const pthread_barrierattr_t *,
|
||||
int *);
|
||||
int pthread_barrierattr_init(pthread_barrierattr_t *);
|
||||
int pthread_barrierattr_setpshared(pthread_barrierattr_t *, int);
|
||||
int pthread_barrier_wait(pthread_barrier_t * _Nonnull);
|
||||
int pthread_barrierattr_destroy(pthread_barrierattr_t * _Nonnull);
|
||||
int pthread_barrierattr_getpshared(
|
||||
const pthread_barrierattr_t * _Nonnull, int * _Nonnull);
|
||||
int pthread_barrierattr_init(pthread_barrierattr_t * _Nonnull);
|
||||
int pthread_barrierattr_setpshared(pthread_barrierattr_t * _Nonnull,
|
||||
int);
|
||||
|
||||
#define pthread_cleanup_push(cleanup_routine, cleanup_arg) \
|
||||
{ \
|
||||
@ -183,100 +192,109 @@ int pthread_barrierattr_setpshared(pthread_barrierattr_t *, int);
|
||||
__pthread_cleanup_pop_imp(execute); \
|
||||
}
|
||||
|
||||
int pthread_condattr_destroy(pthread_condattr_t *);
|
||||
int pthread_condattr_getclock(const pthread_condattr_t *,
|
||||
clockid_t *);
|
||||
int pthread_condattr_getpshared(const pthread_condattr_t *, int *);
|
||||
int pthread_condattr_init(pthread_condattr_t *);
|
||||
int pthread_condattr_setclock(pthread_condattr_t *, clockid_t);
|
||||
int pthread_condattr_setpshared(pthread_condattr_t *, int);
|
||||
int pthread_cond_broadcast(pthread_cond_t *);
|
||||
int pthread_cond_destroy(pthread_cond_t *);
|
||||
int pthread_cond_init(pthread_cond_t *,
|
||||
int pthread_condattr_destroy(pthread_condattr_t * _Nonnull);
|
||||
int pthread_condattr_getclock(const pthread_condattr_t * _Nonnull,
|
||||
clockid_t * _Nonnull);
|
||||
int pthread_condattr_getpshared(const pthread_condattr_t * _Nonnull,
|
||||
int * _Nonnull);
|
||||
int pthread_condattr_init(pthread_condattr_t * _Nonnull);
|
||||
int pthread_condattr_setclock(pthread_condattr_t * _Nonnull,
|
||||
clockid_t);
|
||||
int pthread_condattr_setpshared(pthread_condattr_t * _Nonnull, int);
|
||||
int pthread_cond_broadcast(pthread_cond_t * _Nonnull);
|
||||
int pthread_cond_destroy(pthread_cond_t * _Nonnull);
|
||||
int pthread_cond_init(pthread_cond_t * _Nonnull,
|
||||
const pthread_condattr_t *);
|
||||
int pthread_cond_signal(pthread_cond_t *);
|
||||
int pthread_cond_timedwait(pthread_cond_t *,
|
||||
pthread_mutex_t *__mutex, const struct timespec *)
|
||||
int pthread_cond_signal(pthread_cond_t * _Nonnull);
|
||||
int pthread_cond_timedwait(pthread_cond_t * _Nonnull,
|
||||
pthread_mutex_t * _Nonnull __mutex,
|
||||
const struct timespec * _Nonnull)
|
||||
__requires_exclusive(*__mutex);
|
||||
int pthread_cond_wait(pthread_cond_t *, pthread_mutex_t *__mutex)
|
||||
int pthread_cond_wait(pthread_cond_t * _Nonnull,
|
||||
pthread_mutex_t * _Nonnull __mutex)
|
||||
__requires_exclusive(*__mutex);
|
||||
int pthread_create(pthread_t *, const pthread_attr_t *,
|
||||
void *(*) (void *), void *);
|
||||
int pthread_create(pthread_t * _Nonnull, const pthread_attr_t *,
|
||||
void *(* _Nonnull) (void *), void *);
|
||||
int pthread_detach(pthread_t);
|
||||
int pthread_equal(pthread_t, pthread_t);
|
||||
void pthread_exit(void *) __dead2;
|
||||
void *pthread_getspecific(pthread_key_t);
|
||||
int pthread_getcpuclockid(pthread_t, clockid_t *);
|
||||
int pthread_getcpuclockid(pthread_t, clockid_t * _Nonnull);
|
||||
int pthread_join(pthread_t, void **);
|
||||
int pthread_key_create(pthread_key_t *,
|
||||
void (*) (void *));
|
||||
int pthread_key_create(pthread_key_t * _Nonnull,
|
||||
void (*) (void *));
|
||||
int pthread_key_delete(pthread_key_t);
|
||||
int pthread_mutexattr_init(pthread_mutexattr_t *);
|
||||
int pthread_mutexattr_destroy(pthread_mutexattr_t *);
|
||||
int pthread_mutexattr_getpshared(const pthread_mutexattr_t *,
|
||||
int *);
|
||||
int pthread_mutexattr_gettype(pthread_mutexattr_t *, int *);
|
||||
int pthread_mutexattr_settype(pthread_mutexattr_t *, int);
|
||||
int pthread_mutexattr_setpshared(pthread_mutexattr_t *, int);
|
||||
int pthread_mutex_consistent(pthread_mutex_t *__mutex)
|
||||
__nonnull(1) __requires_exclusive(*__mutex);
|
||||
int pthread_mutex_destroy(pthread_mutex_t *__mutex)
|
||||
int pthread_mutexattr_init(pthread_mutexattr_t * _Nonnull);
|
||||
int pthread_mutexattr_destroy(pthread_mutexattr_t * _Nonnull);
|
||||
int pthread_mutexattr_getpshared(
|
||||
const pthread_mutexattr_t * _Nonnull, int * _Nonnull);
|
||||
int pthread_mutexattr_gettype(pthread_mutexattr_t * _Nonnull,
|
||||
int * _Nonnull);
|
||||
int pthread_mutexattr_settype(pthread_mutexattr_t * _Nonnull, int);
|
||||
int pthread_mutexattr_setpshared(pthread_mutexattr_t * _Nonnull,
|
||||
int);
|
||||
int pthread_mutex_consistent(pthread_mutex_t * _Nonnull __mutex)
|
||||
__requires_exclusive(*__mutex);
|
||||
int pthread_mutex_destroy(pthread_mutex_t * _Nonnull __mutex)
|
||||
__requires_unlocked(*__mutex);
|
||||
int pthread_mutex_init(pthread_mutex_t *__mutex,
|
||||
const pthread_mutexattr_t *)
|
||||
int pthread_mutex_init(pthread_mutex_t * _Nonnull __mutex,
|
||||
const pthread_mutexattr_t *)
|
||||
__requires_unlocked(*__mutex);
|
||||
int pthread_mutex_lock(pthread_mutex_t *__mutex)
|
||||
__locks_exclusive(*__mutex);
|
||||
int pthread_mutex_trylock(pthread_mutex_t *__mutex)
|
||||
__trylocks_exclusive(0, *__mutex);
|
||||
int pthread_mutex_timedlock(pthread_mutex_t *__mutex,
|
||||
const struct timespec *)
|
||||
__trylocks_exclusive(0, *__mutex);
|
||||
int pthread_mutex_unlock(pthread_mutex_t *__mutex)
|
||||
int pthread_mutex_lock(pthread_mutex_t * _Nonnull __mutex)
|
||||
__locks_exclusive(*__mutex);
|
||||
int pthread_mutex_trylock(pthread_mutex_t * _Nonnull __mutex)
|
||||
__trylocks_exclusive(0, *__mutex);
|
||||
int pthread_mutex_timedlock(pthread_mutex_t * _Nonnull __mutex,
|
||||
const struct timespec * _Nonnull)
|
||||
__trylocks_exclusive(0, *__mutex);
|
||||
int pthread_mutex_unlock(pthread_mutex_t * _Nonnull __mutex)
|
||||
__unlocks(*__mutex);
|
||||
int pthread_once(pthread_once_t *, void (*) (void));
|
||||
int pthread_rwlock_destroy(pthread_rwlock_t *__rwlock)
|
||||
int pthread_once(pthread_once_t * _Nonnull,
|
||||
void (* _Nonnull) (void));
|
||||
int pthread_rwlock_destroy(pthread_rwlock_t * _Nonnull __rwlock)
|
||||
__requires_unlocked(*__rwlock);
|
||||
int pthread_rwlock_init(pthread_rwlock_t *__rwlock,
|
||||
const pthread_rwlockattr_t *)
|
||||
int pthread_rwlock_init(pthread_rwlock_t * _Nonnull __rwlock,
|
||||
const pthread_rwlockattr_t *)
|
||||
__requires_unlocked(*__rwlock);
|
||||
int pthread_rwlock_rdlock(pthread_rwlock_t *__rwlock)
|
||||
__locks_shared(*__rwlock);
|
||||
int pthread_rwlock_timedrdlock(pthread_rwlock_t *__rwlock,
|
||||
const struct timespec *)
|
||||
__trylocks_shared(0, *__rwlock);
|
||||
int pthread_rwlock_timedwrlock(pthread_rwlock_t *__rwlock,
|
||||
const struct timespec *)
|
||||
__trylocks_exclusive(0, *__rwlock);
|
||||
int pthread_rwlock_tryrdlock(pthread_rwlock_t *__rwlock)
|
||||
__trylocks_shared(0, *__rwlock);
|
||||
int pthread_rwlock_trywrlock(pthread_rwlock_t *__rwlock)
|
||||
__trylocks_exclusive(0, *__rwlock);
|
||||
int pthread_rwlock_unlock(pthread_rwlock_t *__rwlock)
|
||||
int pthread_rwlock_rdlock(pthread_rwlock_t * _Nonnull __rwlock)
|
||||
__locks_shared(*__rwlock);
|
||||
int pthread_rwlock_timedrdlock(pthread_rwlock_t * _Nonnull __rwlock,
|
||||
const struct timespec * _Nonnull)
|
||||
__trylocks_shared(0, *__rwlock);
|
||||
int pthread_rwlock_timedwrlock(pthread_rwlock_t * _Nonnull __rwlock,
|
||||
const struct timespec * _Nonnull)
|
||||
__trylocks_exclusive(0, *__rwlock);
|
||||
int pthread_rwlock_tryrdlock(pthread_rwlock_t * _Nonnull __rwlock)
|
||||
__trylocks_shared(0, *__rwlock);
|
||||
int pthread_rwlock_trywrlock(pthread_rwlock_t * _Nonnull __rwlock)
|
||||
__trylocks_exclusive(0, *__rwlock);
|
||||
int pthread_rwlock_unlock(pthread_rwlock_t * _Nonnull __rwlock)
|
||||
__unlocks(*__rwlock);
|
||||
int pthread_rwlock_wrlock(pthread_rwlock_t *__rwlock)
|
||||
__locks_exclusive(*__rwlock);
|
||||
int pthread_rwlockattr_destroy(pthread_rwlockattr_t *);
|
||||
int pthread_rwlockattr_getkind_np(const pthread_rwlockattr_t *,
|
||||
int *);
|
||||
int pthread_rwlockattr_getpshared(const pthread_rwlockattr_t *,
|
||||
int *);
|
||||
int pthread_rwlockattr_init(pthread_rwlockattr_t *);
|
||||
int pthread_rwlockattr_setkind_np(pthread_rwlockattr_t *, int);
|
||||
int pthread_rwlockattr_setpshared(pthread_rwlockattr_t *, int);
|
||||
int pthread_rwlock_wrlock(pthread_rwlock_t * _Nonnull __rwlock)
|
||||
__locks_exclusive(*__rwlock);
|
||||
int pthread_rwlockattr_destroy(pthread_rwlockattr_t * _Nonnull);
|
||||
int pthread_rwlockattr_getkind_np(
|
||||
const pthread_rwlockattr_t * _Nonnull, int *);
|
||||
int pthread_rwlockattr_getpshared(
|
||||
const pthread_rwlockattr_t * _Nonnull, int * _Nonnull);
|
||||
int pthread_rwlockattr_init(pthread_rwlockattr_t * _Nonnull);
|
||||
int pthread_rwlockattr_setkind_np(pthread_rwlockattr_t * _Nonnull,
|
||||
int);
|
||||
int pthread_rwlockattr_setpshared(pthread_rwlockattr_t * _Nonnull,
|
||||
int);
|
||||
pthread_t pthread_self(void);
|
||||
int pthread_setspecific(pthread_key_t, const void *);
|
||||
|
||||
int pthread_spin_init(pthread_spinlock_t *__spin, int)
|
||||
int pthread_spin_init(pthread_spinlock_t * _Nonnull __spin, int)
|
||||
__requires_unlocked(*__spin);
|
||||
int pthread_spin_destroy(pthread_spinlock_t *__spin)
|
||||
int pthread_spin_destroy(pthread_spinlock_t * _Nonnull __spin)
|
||||
__requires_unlocked(*__spin);
|
||||
int pthread_spin_lock(pthread_spinlock_t *__spin)
|
||||
__locks_exclusive(*__spin);
|
||||
int pthread_spin_trylock(pthread_spinlock_t *__spin)
|
||||
__trylocks_exclusive(0, *__spin);
|
||||
int pthread_spin_unlock(pthread_spinlock_t *__spin)
|
||||
__unlocks(*__spin);
|
||||
int pthread_spin_lock(pthread_spinlock_t * _Nonnull __spin)
|
||||
__locks_exclusive(*__spin);
|
||||
int pthread_spin_trylock(pthread_spinlock_t * _Nonnull __spin)
|
||||
__trylocks_exclusive(0, *__spin);
|
||||
int pthread_spin_unlock(pthread_spinlock_t * _Nonnull __spin)
|
||||
__unlocks(*__spin);
|
||||
int pthread_cancel(pthread_t);
|
||||
int pthread_setcancelstate(int, int *);
|
||||
int pthread_setcanceltype(int, int *);
|
||||
@ -288,35 +306,36 @@ int pthread_setprio(pthread_t, int);
|
||||
void pthread_yield(void);
|
||||
#endif
|
||||
|
||||
int pthread_mutexattr_getprioceiling(pthread_mutexattr_t *,
|
||||
int *);
|
||||
int pthread_mutexattr_setprioceiling(pthread_mutexattr_t *,
|
||||
int);
|
||||
int pthread_mutexattr_getprioceiling(pthread_mutexattr_t *, int *);
|
||||
int pthread_mutexattr_setprioceiling(pthread_mutexattr_t *, int);
|
||||
int pthread_mutex_getprioceiling(pthread_mutex_t *, int *);
|
||||
int pthread_mutex_setprioceiling(pthread_mutex_t *, int, int *);
|
||||
|
||||
int pthread_mutexattr_getprotocol(pthread_mutexattr_t *, int *);
|
||||
int pthread_mutexattr_setprotocol(pthread_mutexattr_t *, int);
|
||||
|
||||
int pthread_mutexattr_getrobust(pthread_mutexattr_t *__restrict,
|
||||
int *__restrict) __nonnull_all;
|
||||
int pthread_mutexattr_setrobust(pthread_mutexattr_t *, int)
|
||||
__nonnull(1);
|
||||
int pthread_mutexattr_getrobust(
|
||||
pthread_mutexattr_t * _Nonnull __restrict,
|
||||
int * _Nonnull __restrict);
|
||||
int pthread_mutexattr_setrobust(pthread_mutexattr_t * _Nonnull,
|
||||
int);
|
||||
|
||||
int pthread_attr_getinheritsched(const pthread_attr_t *, int *);
|
||||
int pthread_attr_getschedparam(const pthread_attr_t *,
|
||||
struct sched_param *);
|
||||
int pthread_attr_getschedpolicy(const pthread_attr_t *, int *);
|
||||
int pthread_attr_getscope(const pthread_attr_t *, int *);
|
||||
int pthread_attr_getschedparam(const pthread_attr_t * _Nonnull,
|
||||
struct sched_param * _Nonnull);
|
||||
int pthread_attr_getschedpolicy(const pthread_attr_t * _Nonnull,
|
||||
int * _Nonnull);
|
||||
int pthread_attr_getscope(const pthread_attr_t * _Nonnull,
|
||||
int * _Nonnull);
|
||||
int pthread_attr_setinheritsched(pthread_attr_t *, int);
|
||||
int pthread_attr_setschedparam(pthread_attr_t *,
|
||||
const struct sched_param *);
|
||||
int pthread_attr_setschedpolicy(pthread_attr_t *, int);
|
||||
int pthread_attr_setscope(pthread_attr_t *, int);
|
||||
int pthread_getschedparam(pthread_t pthread, int *,
|
||||
struct sched_param *);
|
||||
int pthread_attr_setschedparam(pthread_attr_t * _Nonnull,
|
||||
const struct sched_param * _Nonnull);
|
||||
int pthread_attr_setschedpolicy(pthread_attr_t * _Nonnull, int);
|
||||
int pthread_attr_setscope(pthread_attr_t * _Nonnull, int);
|
||||
int pthread_getschedparam(pthread_t pthread, int * _Nonnull,
|
||||
struct sched_param * _Nonnull);
|
||||
int pthread_setschedparam(pthread_t, int,
|
||||
const struct sched_param *);
|
||||
const struct sched_param * _Nonnull);
|
||||
#if __XSI_VISIBLE
|
||||
int pthread_getconcurrency(void);
|
||||
int pthread_setconcurrency(int);
|
||||
@ -326,5 +345,6 @@ void __pthread_cleanup_push_imp(void (*)(void *), void *,
|
||||
struct _pthread_cleanup_info *);
|
||||
void __pthread_cleanup_pop_imp(int);
|
||||
__END_DECLS
|
||||
__NULLABILITY_PRAGMA_POP
|
||||
|
||||
#endif
|
||||
#endif /* _PTHREAD_H_ */
|
||||
|
@ -41,6 +41,8 @@
|
||||
#include <sys/_ucontext.h>
|
||||
#endif
|
||||
|
||||
__NULLABILITY_PRAGMA_PUSH
|
||||
|
||||
#if __BSD_VISIBLE
|
||||
/*
|
||||
* XXX should enlarge these, if only to give empty names instead of bounds
|
||||
@ -82,10 +84,11 @@ int sigdelset(sigset_t *, int);
|
||||
int sigemptyset(sigset_t *);
|
||||
int sigfillset(sigset_t *);
|
||||
int sigismember(const sigset_t *, int);
|
||||
int sigpending(sigset_t *);
|
||||
int sigpending(sigset_t * _Nonnull);
|
||||
int sigprocmask(int, const sigset_t * __restrict, sigset_t * __restrict);
|
||||
int sigsuspend(const sigset_t *);
|
||||
int sigwait(const sigset_t * __restrict, int * __restrict);
|
||||
int sigsuspend(const sigset_t * _Nonnull);
|
||||
int sigwait(const sigset_t * _Nonnull __restrict,
|
||||
int * _Nonnull __restrict);
|
||||
#endif
|
||||
|
||||
#if __POSIX_VISIBLE >= 199506 || __XSI_VISIBLE >= 600
|
||||
@ -104,7 +107,7 @@ int sighold(int);
|
||||
int sigignore(int);
|
||||
int sigpause(int);
|
||||
int sigrelse(int);
|
||||
void (*sigset(int, void (*)(int)))(int);
|
||||
void (* _Nullable sigset(int, void (* _Nullable)(int)))(int);
|
||||
int xsi_sigpause(int);
|
||||
#endif
|
||||
|
||||
@ -124,5 +127,6 @@ int sigstack(const struct sigstack *, struct sigstack *);
|
||||
int sigvec(int, struct sigvec *, struct sigvec *);
|
||||
#endif
|
||||
__END_DECLS
|
||||
__NULLABILITY_PRAGMA_POP
|
||||
|
||||
#endif /* !_SIGNAL_H_ */
|
||||
|
@ -40,6 +40,8 @@
|
||||
#include <sys/_null.h>
|
||||
#include <sys/_types.h>
|
||||
|
||||
__NULLABILITY_PRAGMA_PUSH
|
||||
|
||||
typedef __off_t fpos_t;
|
||||
|
||||
#ifndef _SIZE_T_DECLARED
|
||||
@ -123,10 +125,10 @@ struct __sFILE {
|
||||
|
||||
/* operations */
|
||||
void *_cookie; /* (*) cookie passed to io functions */
|
||||
int (*_close)(void *);
|
||||
int (*_read)(void *, char *, int);
|
||||
fpos_t (*_seek)(void *, fpos_t, int);
|
||||
int (*_write)(void *, const char *, int);
|
||||
int (* _Nullable _close)(void *);
|
||||
int (* _Nullable _read)(void *, char *, int);
|
||||
fpos_t (* _Nullable _seek)(void *, fpos_t, int);
|
||||
int (* _Nullable _write)(void *, const char *, int);
|
||||
|
||||
/* separate buffer for long sequences of ungetc() */
|
||||
struct __sbuf _ub; /* ungetc buffer */
|
||||
@ -390,10 +392,10 @@ extern const char * const sys_errlist[];
|
||||
* Stdio function-access interface.
|
||||
*/
|
||||
FILE *funopen(const void *,
|
||||
int (*)(void *, char *, int),
|
||||
int (*)(void *, const char *, int),
|
||||
fpos_t (*)(void *, fpos_t, int),
|
||||
int (*)(void *));
|
||||
int (* _Nullable)(void *, char *, int),
|
||||
int (* _Nullable)(void *, const char *, int),
|
||||
fpos_t (* _Nullable)(void *, fpos_t, int),
|
||||
int (* _Nullable)(void *));
|
||||
#define fropen(cookie, fn) funopen(cookie, fn, 0, 0, 0)
|
||||
#define fwopen(cookie, fn) funopen(cookie, 0, fn, 0, 0)
|
||||
|
||||
@ -506,4 +508,6 @@ extern int __isthreaded;
|
||||
#endif /* __cplusplus */
|
||||
|
||||
__END_DECLS
|
||||
__NULLABILITY_PRAGMA_POP
|
||||
|
||||
#endif /* !_STDIO_H_ */
|
||||
|
@ -37,6 +37,8 @@
|
||||
#include <sys/_null.h>
|
||||
#include <sys/_types.h>
|
||||
|
||||
__NULLABILITY_PRAGMA_PUSH
|
||||
|
||||
#if __BSD_VISIBLE
|
||||
#ifndef _RUNE_T_DECLARED
|
||||
typedef __rune_t rune_t;
|
||||
@ -81,12 +83,12 @@ extern int ___mb_cur_max(void);
|
||||
|
||||
_Noreturn void abort(void);
|
||||
int abs(int) __pure2;
|
||||
int atexit(void (*)(void));
|
||||
int atexit(void (* _Nonnull)(void));
|
||||
double atof(const char *);
|
||||
int atoi(const char *);
|
||||
long atol(const char *);
|
||||
void *bsearch(const void *, const void *, size_t,
|
||||
size_t, int (*)(const void *, const void *));
|
||||
size_t, int (*)(const void * _Nonnull, const void *));
|
||||
void *calloc(size_t, size_t) __malloc_like __result_use_check
|
||||
__alloc_size(1) __alloc_size(2);
|
||||
div_t div(int, int) __pure2;
|
||||
@ -100,7 +102,7 @@ int mblen(const char *, size_t);
|
||||
size_t mbstowcs(wchar_t * __restrict , const char * __restrict, size_t);
|
||||
int mbtowc(wchar_t * __restrict, const char * __restrict, size_t);
|
||||
void qsort(void *, size_t, size_t,
|
||||
int (*)(const void *, const void *));
|
||||
int (* _Nonnull)(const void *, const void *));
|
||||
int rand(void);
|
||||
void *realloc(void *, size_t) __result_use_check __alloc_size(2);
|
||||
void srand(unsigned);
|
||||
@ -256,9 +258,9 @@ void arc4random_stir(void);
|
||||
__uint32_t
|
||||
arc4random_uniform(__uint32_t);
|
||||
#ifdef __BLOCKS__
|
||||
int atexit_b(void (^)(void));
|
||||
int atexit_b(void (^ _Nonnull)(void));
|
||||
void *bsearch_b(const void *, const void *, size_t,
|
||||
size_t, int (^)(const void *, const void *));
|
||||
size_t, int (^ _Nonnull)(const void *, const void *));
|
||||
#endif
|
||||
char *getbsize(int *, long *);
|
||||
/* getcap(3) functions */
|
||||
@ -282,11 +284,13 @@ int getloadavg(double [], int);
|
||||
const char *
|
||||
getprogname(void);
|
||||
|
||||
int heapsort(void *, size_t, size_t, int (*)(const void *, const void *));
|
||||
int heapsort(void *, size_t, size_t,
|
||||
int (* _Nonnull)(const void *, const void *));
|
||||
#ifdef __BLOCKS__
|
||||
int heapsort_b(void *, size_t, size_t, int (^)(const void *, const void *));
|
||||
int heapsort_b(void *, size_t, size_t,
|
||||
int (^ _Nonnull)(const void *, const void *));
|
||||
void qsort_b(void *, size_t, size_t,
|
||||
int (^)(const void *, const void *));
|
||||
int (^ _Nonnull)(const void *, const void *));
|
||||
#endif
|
||||
int l64a_r(long, char *, int);
|
||||
int mergesort(void *, size_t, size_t, int (*)(const void *, const void *));
|
||||
@ -320,5 +324,6 @@ __uint64_t
|
||||
extern char *suboptarg; /* getsubopt(3) external variable */
|
||||
#endif /* __BSD_VISIBLE */
|
||||
__END_DECLS
|
||||
__NULLABILITY_PRAGMA_POP
|
||||
|
||||
#endif /* !_STDLIB_H_ */
|
||||
|
@ -106,7 +106,7 @@ SUBDIR_DEPEND_libdevstat= libkvm
|
||||
SUBDIR_DEPEND_libdpv= libfigpar ncurses libutil
|
||||
SUBDIR_DEPEND_libedit= ncurses
|
||||
SUBDIR_DEPEND_libgeom= libexpat libsbuf
|
||||
SUBDIR_DEPEND_liblibrpcsec_gss= libgssapi
|
||||
SUBDIR_DEPEND_librpcsec_gss= libgssapi
|
||||
SUBDIR_DEPEND_libmagic= libz
|
||||
SUBDIR_DEPEND_libmemstat= libkvm
|
||||
SUBDIR_DEPEND_libopie= libmd
|
||||
|
@ -120,7 +120,7 @@ tables.h: mktables
|
||||
ioctl.c: .PHONY
|
||||
.endif
|
||||
ioctl.c: mkioctls .META
|
||||
env MACHINE=${MACHINE} CPP="${CPP}" \
|
||||
env CPP="${CPP}" \
|
||||
/bin/sh ${.CURDIR}/mkioctls ${DESTDIR}${INCLUDEDIR} > ${.TARGET}
|
||||
|
||||
beforedepend: ioctl.c tables.h
|
||||
|
@ -24,15 +24,7 @@ ioctl_includes=$(
|
||||
awk '{printf("#include <%s>\\n", $1)}'
|
||||
)
|
||||
|
||||
: ${MACHINE=$(uname -m)}
|
||||
case "${MACHINE}" in
|
||||
*pc98*)
|
||||
ioctl_includes="$ioctl_includes#include <sys/diskpc98.h>\\n"
|
||||
;;
|
||||
*)
|
||||
ioctl_includes="$ioctl_includes#include <sys/diskmbr.h>\\n"
|
||||
;;
|
||||
esac
|
||||
ioctl_includes="$ioctl_includes#include <sys/diskmbr.h>\\n"
|
||||
|
||||
awk -v x="$ioctl_includes" 'BEGIN {print x}' |
|
||||
$CPP -nostdinc -I$includedir -dM -DCOMPAT_43TTY - |
|
||||
|
@ -53,6 +53,8 @@
|
||||
#include <sys/thr.h>
|
||||
#include <pthread.h>
|
||||
|
||||
__NULLABILITY_PRAGMA_PUSH
|
||||
|
||||
#define SYM_FB10(sym) __CONCAT(sym, _fb10)
|
||||
#define SYM_FBP10(sym) __CONCAT(sym, _fbp10)
|
||||
#define WEAK_REF(sym, alias) __weak_reference(sym, alias)
|
||||
@ -835,11 +837,10 @@ void _pthread_cleanup_pop(int);
|
||||
void _pthread_exit_mask(void *status, sigset_t *mask) __dead2 __hidden;
|
||||
void _pthread_cancel_enter(int maycancel);
|
||||
void _pthread_cancel_leave(int maycancel);
|
||||
int _pthread_mutex_consistent(pthread_mutex_t *) __nonnull(1);
|
||||
int _pthread_mutexattr_getrobust(pthread_mutexattr_t *__restrict,
|
||||
int *__restrict) __nonnull_all;
|
||||
int _pthread_mutexattr_setrobust(pthread_mutexattr_t *, int)
|
||||
__nonnull(1);
|
||||
int _pthread_mutex_consistent(pthread_mutex_t * _Nonnull);
|
||||
int _pthread_mutexattr_getrobust(pthread_mutexattr_t * _Nonnull __restrict,
|
||||
int * _Nonnull __restrict);
|
||||
int _pthread_mutexattr_setrobust(pthread_mutexattr_t * _Nonnull, int);
|
||||
|
||||
/* #include <fcntl.h> */
|
||||
#ifdef _SYS_FCNTL_H_
|
||||
@ -984,5 +985,6 @@ void __thr_pshared_atfork_pre(void) __hidden;
|
||||
void __thr_pshared_atfork_post(void) __hidden;
|
||||
|
||||
__END_DECLS
|
||||
__NULLABILITY_PRAGMA_POP
|
||||
|
||||
#endif /* !_THR_PRIVATE_H */
|
||||
|
@ -1,4 +0,0 @@
|
||||
# $FreeBSD$
|
||||
|
||||
# Because i386 adds extra stuff we don't need or want for PC98 we need
|
||||
# an empty file so it doesn't get added.
|
@ -99,7 +99,7 @@ element will be included. For example:
|
||||
|
||||
<para arch="sparc64">SPARC64-specific text</para>
|
||||
|
||||
The currently-supported architectures are amd64, arm, i386, pc98,
|
||||
The currently-supported architectures are amd64, arm, i386,
|
||||
powerpc and sparc64. An element may appear for multiple architectures
|
||||
by specifying a comma-separated list of architectures
|
||||
(i.e. arch="sparc64,amd64").
|
||||
|
@ -252,35 +252,6 @@
|
||||
more information.</para>
|
||||
</sect2>
|
||||
|
||||
<sect2 xml:id="proc-pc98">
|
||||
<title>pc98</title>
|
||||
|
||||
<para>NEC PC-9801/9821 series with almost all &i386;-compatible
|
||||
processors, including 80486, &pentium;, &pentium; Pro,
|
||||
&pentium; II, and variants. All &i386;-compatible processors
|
||||
by AMD, Cyrix, IBM, and IDT are also supported.</para>
|
||||
|
||||
<para>NEC FC-9801/9821 series, and NEC SV-98 series (both of
|
||||
them are compatible with PC-9801/9821 series) should be
|
||||
supported.</para>
|
||||
|
||||
<para>EPSON PC-386/486/586 series, which are compatible with NEC
|
||||
PC-9801 series are supported.</para>
|
||||
|
||||
<para>High-resolution mode is not supported. NEC
|
||||
PC-98XA/XL/RL/XL^2, and NEC PC-H98 series are supported in
|
||||
normal (PC-9801 compatible) mode only.</para>
|
||||
|
||||
<para>Although there are some multi-processor systems (such as
|
||||
Rs20/B20), SMP-related features of &os; are not supported
|
||||
yet.</para>
|
||||
|
||||
<para>PC-9801/9821 standard bus (called C-Bus), PC-9801NOTE
|
||||
expansion bus (110pin), and PCI bus are supported. New Extend
|
||||
Standard Architecture (NESA) bus (used in PC-H98, SV-H98, and
|
||||
FC-H98 series) is not supported.</para>
|
||||
</sect2>
|
||||
|
||||
<sect2 xml:id="proc-powerpc">
|
||||
<title>powerpc</title>
|
||||
|
||||
@ -636,17 +607,9 @@
|
||||
<sect2 xml:id="disk">
|
||||
<title>Disk Controllers</title>
|
||||
|
||||
<para>[&arch.amd64;, &arch.i386;, &arch.pc98;, &arch.sparc64;]
|
||||
<para>[&arch.amd64;, &arch.i386;, &arch.sparc64;]
|
||||
IDE/ATA controllers (&man.ata.4; driver)</para>
|
||||
|
||||
<para>[&arch.pc98;] IDE/ATA controllers (wdc driver)</para>
|
||||
|
||||
<itemizedlist>
|
||||
<listitem>
|
||||
<para>On-board IDE controller</para>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
|
||||
&hwlist.aac;
|
||||
|
||||
&hwlist.adv;
|
||||
@ -673,8 +636,6 @@
|
||||
|
||||
&hwlist.ciss;
|
||||
|
||||
&hwlist.ct;
|
||||
|
||||
&hwlist.dpt;
|
||||
|
||||
<note>
|
||||
@ -894,8 +855,6 @@
|
||||
|
||||
&hwlist.sn;
|
||||
|
||||
&hwlist.snc;
|
||||
|
||||
&hwlist.ste;
|
||||
|
||||
&hwlist.stge;
|
||||
@ -904,7 +863,7 @@
|
||||
|
||||
&hwlist.tl;
|
||||
|
||||
<para>[&arch.amd64;, &arch.i386;, &arch.pc98;] SMC 83c17x
|
||||
<para>[&arch.amd64;, &arch.i386;] SMC 83c17x
|
||||
(EPIC)-based Ethernet NICs (&man.tx.4; driver)</para>
|
||||
|
||||
&hwlist.txp;
|
||||
@ -934,8 +893,7 @@
|
||||
<sect2 xml:id="fddi">
|
||||
<title>FDDI Interfaces</title>
|
||||
|
||||
<para>[&arch.i386;, &arch.pc98;] DEC DEFPA PCI (&man.fpa.4;
|
||||
driver)</para>
|
||||
<para>[&arch.i386;] DEC DEFPA PCI (&man.fpa.4; driver)</para>
|
||||
|
||||
<para>[&arch.i386;] DEC DEFEA EISA (&man.fpa.4; driver)</para>
|
||||
</sect2>
|
||||
@ -943,28 +901,28 @@
|
||||
<sect2 xml:id="atm">
|
||||
<title>ATM Interfaces</title>
|
||||
|
||||
<para>[&arch.i386;, &arch.pc98;] Midway-based ATM interfaces
|
||||
<para>[&arch.i386;] Midway-based ATM interfaces
|
||||
(&man.en.4; driver)</para>
|
||||
|
||||
<para>[&arch.i386;, &arch.pc98; &arch.sparc64;] FORE Systems,
|
||||
<para>[&arch.i386;, &arch.sparc64;] FORE Systems,
|
||||
Inc. PCA-200E ATM PCI Adapters (hfa and &man.fatm.4;
|
||||
drivers)</para>
|
||||
|
||||
<para>[&arch.i386;, &arch.pc98;] IDT NICStAR 77201/211-based ATM
|
||||
<para>[&arch.i386;] IDT NICStAR 77201/211-based ATM
|
||||
Adapters (&man.idt.4; driver)</para>
|
||||
|
||||
<para>[&arch.i386;, &arch.pc98; &arch.sparc64;] FORE Systems,
|
||||
<para>[&arch.i386;, &arch.sparc64;] FORE Systems,
|
||||
Inc. HE155 and HE622 ATM interfaces (&man.hatm.4;
|
||||
driver)</para>
|
||||
|
||||
<para>[&arch.i386;, &arch.pc98;] IDT77252-based ATM cards
|
||||
<para>[&arch.i386;] IDT77252-based ATM cards
|
||||
(&man.patm.4; driver)</para>
|
||||
</sect2>
|
||||
|
||||
<sect2 xml:id="wlan">
|
||||
<title>Wireless Network Interfaces</title>
|
||||
|
||||
<para>[&arch.amd64;, &arch.i386;, &arch.pc98;] Cisco/Aironet
|
||||
<para>[&arch.amd64;, &arch.i386;] Cisco/Aironet
|
||||
802.11b wireless adapters (&man.an.4; driver)</para>
|
||||
|
||||
&hwlist.ath;
|
||||
@ -1016,7 +974,7 @@
|
||||
|
||||
&hwlist.urtw;
|
||||
|
||||
<para>[&arch.amd64;, &arch.i386;, &arch.pc98;] Lucent
|
||||
<para>[&arch.amd64;, &arch.i386;] Lucent
|
||||
Technologies WaveLAN/IEEE 802.11b wireless network adapters
|
||||
and workalikes using the Lucent Hermes, Intersil PRISM-II,
|
||||
Intersil PRISM-2.5, Intersil Prism-3, and Symbol Spectrum24
|
||||
@ -1214,77 +1172,6 @@
|
||||
|
||||
&hwlist.rc;
|
||||
|
||||
<para>[&arch.pc98;] Internel serial interfaces (&man.sio.4;
|
||||
driver)</para>
|
||||
|
||||
<itemizedlist>
|
||||
<listitem>
|
||||
<para>PC-9801 on-board</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>PC-9821 2'nd CCU (flags 0x12000000)</para>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
|
||||
<para>[&arch.pc98;] NEC PC-9861K, PC-9801-101 and Midori-Denshi
|
||||
MDC-926Rs (&man.sio.4; driver)</para>
|
||||
|
||||
<itemizedlist>
|
||||
<listitem>
|
||||
<para>COM2 (flags 0x01000000)</para>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<para>COM3 (flags 0x02000000)</para>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
|
||||
<para>[&arch.pc98;] NEC PC-9801-120 (&man.sio.4; driver)</para>
|
||||
|
||||
<note>
|
||||
<para>"flags 0x11000000" is necessary in kernel
|
||||
configuration.</para>
|
||||
</note>
|
||||
|
||||
<para>[&arch.pc98;] Microcore MC-16550, MC-16550II, MC-RS98
|
||||
(&man.sio.4; driver)</para>
|
||||
|
||||
<note>
|
||||
<para>"flags 0x14000?01" is necessary in kernel
|
||||
configuration.</para>
|
||||
</note>
|
||||
|
||||
<para>[&arch.pc98;] Media Intelligent RSB-2000, RSB-3000 and
|
||||
AIWA B98-02 (&man.sio.4; driver)</para>
|
||||
|
||||
<note>
|
||||
<para>"flags 0x15000?01" is necessary in kernel
|
||||
configuration.</para>
|
||||
</note>
|
||||
|
||||
<para>[&arch.pc98;] Media Intelligent RSB-384 (&man.sio.4;
|
||||
driver)</para>
|
||||
|
||||
<note>
|
||||
<para>"flags 0x16000001" is necessary in kernel
|
||||
configuration.</para>
|
||||
</note>
|
||||
|
||||
<para>[&arch.pc98;] I-O DATA RSA-98III (&man.sio.4;
|
||||
driver)</para>
|
||||
|
||||
<note>
|
||||
<para>"flags 0x18000?01" is necessary in kernel
|
||||
configuration.</para>
|
||||
</note>
|
||||
|
||||
<para>[&arch.pc98;] Hayes ESP98 (&man.sio.4; driver)</para>
|
||||
|
||||
<note>
|
||||
<para>"options COM_ESP" and "flags 0x19000000" are necessary
|
||||
in kernel configuration.</para>
|
||||
</note>
|
||||
|
||||
</sect2>
|
||||
|
||||
<sect2 xml:id="sound">
|
||||
@ -1350,35 +1237,6 @@
|
||||
|
||||
&hwlist.snd.vibes;
|
||||
|
||||
<para>[&arch.pc98;] NEC PC-9801-73, 86 and compatibles (nss
|
||||
driver)</para>
|
||||
|
||||
<itemizedlist>
|
||||
<listitem>
|
||||
<para>NEC A-MATE internal sound</para>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<para>Q-Vision WaveStar, WaveMaster</para>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
|
||||
<para>[&arch.pc98;] NEC X-MATE, CanBe, ValueStar internal (mss
|
||||
driver)</para>
|
||||
|
||||
<para>[&arch.pc98;] Creative Technologies SoundBlaster(98)
|
||||
(&man.sb.4; driver)</para>
|
||||
|
||||
<para>[&arch.pc98;] I-O DATA CD-BOX (&man.sb.4; driver)</para>
|
||||
|
||||
<para>[&arch.pc98;] MPU-401 and compatible interfaces (mpu
|
||||
driver)</para>
|
||||
|
||||
<itemizedlist>
|
||||
<listitem>
|
||||
<para>Q-Vision WaveStar</para>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
</sect2>
|
||||
|
||||
<sect2 xml:id="camera">
|
||||
@ -1392,7 +1250,7 @@
|
||||
<sect2 xml:id="usb">
|
||||
<title>USB Devices</title>
|
||||
|
||||
<para>[&arch.amd64;, &arch.i386;, &arch.pc98;] A
|
||||
<para>[&arch.amd64;, &arch.i386;] A
|
||||
range of USB peripherals are supported; devices known to work
|
||||
are listed in this section. Owing to the generic nature of
|
||||
most USB devices, with some exceptions any device of a given
|
||||
@ -1400,14 +1258,14 @@
|
||||
here.</para>
|
||||
|
||||
<note>
|
||||
<para>[&arch.amd64;, &arch.i386;, &arch.pc98;]
|
||||
<para>[&arch.amd64;, &arch.i386;]
|
||||
USB Ethernet adapters can be found in the section listing
|
||||
<link linkend="ethernet">Ethernet
|
||||
interfaces</link>.</para>
|
||||
</note>
|
||||
|
||||
<note>
|
||||
<para>[&arch.amd64;, &arch.i386;, &arch.pc98;]
|
||||
<para>[&arch.amd64;, &arch.i386;]
|
||||
USB Bluetooth adapters can be found in <link linkend="bluetooth">Bluetooth</link> section.</para>
|
||||
</note>
|
||||
|
||||
@ -1415,18 +1273,15 @@
|
||||
|
||||
&hwlist.uhci;
|
||||
|
||||
<para>[&arch.amd64;, &arch.i386;, &arch.pc98;] USB
|
||||
<para>[&arch.amd64;, &arch.i386;] USB
|
||||
2.0 controllers using the EHCI interface (&man.ehci.4;
|
||||
driver)</para>
|
||||
|
||||
<para>[&arch.amd64;, &arch.i386;, &arch.pc98;]
|
||||
Hubs</para>
|
||||
<para>[&arch.amd64;, &arch.i386;] Hubs</para>
|
||||
|
||||
<para>[&arch.amd64;, &arch.i386;, &arch.pc98;]
|
||||
Keyboards (&man.ukbd.4; driver)</para>
|
||||
<para>[&arch.amd64;, &arch.i386;] Keyboards (&man.ukbd.4; driver)</para>
|
||||
|
||||
<para>[&arch.amd64;, &arch.i386;, &arch.pc98;]
|
||||
Miscellaneous</para>
|
||||
<para>[&arch.amd64;, &arch.i386;] Miscellaneous</para>
|
||||
|
||||
<itemizedlist>
|
||||
<listitem>
|
||||
@ -1454,8 +1309,7 @@
|
||||
|
||||
&hwlist.umodem;
|
||||
|
||||
<para>[&arch.amd64;, &arch.i386;, &arch.pc98;] Mice
|
||||
(&man.ums.4; driver)</para>
|
||||
<para>[&arch.amd64;, &arch.i386;] Mice (&man.ums.4; driver)</para>
|
||||
|
||||
&hwlist.ulpt;
|
||||
|
||||
@ -1471,7 +1325,7 @@
|
||||
|
||||
&hwlist.umass;
|
||||
|
||||
<para>[&arch.amd64;, &arch.i386;, &arch.pc98;] Audio Devices
|
||||
<para>[&arch.amd64;, &arch.i386;] Audio Devices
|
||||
(&man.uaudio.4; driver)</para>
|
||||
|
||||
&hwlist.uvisor;
|
||||
@ -1507,8 +1361,7 @@
|
||||
<sect2 xml:id="misc">
|
||||
<title>Miscellaneous</title>
|
||||
|
||||
<para>[&arch.amd64;, &arch.i386;, &arch.pc98;]
|
||||
FAX-Modem/PCCARD</para>
|
||||
<para>[&arch.amd64;, &arch.i386;] FAX-Modem/PCCARD</para>
|
||||
|
||||
<itemizedlist>
|
||||
<listitem>
|
||||
@ -1521,7 +1374,7 @@
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
|
||||
<para>[&arch.amd64;, &arch.i386;, &arch.pc98;] Floppy drives
|
||||
<para>[&arch.amd64;, &arch.i386;] Floppy drives
|
||||
(&man.fdc.4; driver)</para>
|
||||
|
||||
<para>[&arch.amd64;, &arch.i386;] VGA-compatible video cards
|
||||
@ -1533,8 +1386,7 @@
|
||||
found at <uri xlink:href="http://www.x.org/">http://www.x.org/</uri>.</para>
|
||||
</note>
|
||||
|
||||
<para>[&arch.amd64;, &arch.i386;, &arch.pc98;]
|
||||
Keyboards including:</para>
|
||||
<para>[&arch.amd64;, &arch.i386;] Keyboards including:</para>
|
||||
|
||||
<itemizedlist>
|
||||
<listitem>
|
||||
@ -1548,21 +1400,17 @@
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<para>[&arch.pc98;] Standard keyboards</para>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<para>[&arch.amd64;, &arch.i386;, &arch.pc98;]
|
||||
<para>[&arch.amd64;, &arch.i386;]
|
||||
USB keyboards (&man.ukbd.4; driver)</para>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
|
||||
<para>[&arch.amd64;, &arch.i386;, &arch.pc98;]
|
||||
<para>[&arch.amd64;, &arch.i386;]
|
||||
Pointing devices including:</para>
|
||||
|
||||
<itemizedlist>
|
||||
<listitem>
|
||||
<para>[&arch.amd64;, &arch.i386;, &arch.pc98;] Bus mice and
|
||||
<para>[&arch.amd64;, &arch.i386;] Bus mice and
|
||||
compatible devices (&man.mse.4; driver)</para>
|
||||
</listitem>
|
||||
|
||||
@ -1577,7 +1425,7 @@
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<para>[&arch.amd64;, &arch.i386;, &arch.pc98;]
|
||||
<para>[&arch.amd64;, &arch.i386;]
|
||||
USB mice (&man.ums.4; driver)</para>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
@ -1591,17 +1439,10 @@
|
||||
<para>[&arch.amd64;, &arch.i386;] <quote>PC standard</quote>
|
||||
parallel ports (&man.ppc.4; driver)</para>
|
||||
|
||||
<para>[&arch.pc98;] <quote>PC-9821 standard</quote> parallel
|
||||
ports (&man.ppc.4; driver)</para>
|
||||
|
||||
<para>[&arch.i386;, &arch.amd64;] PC-compatible joysticks
|
||||
(&man.joy.4; driver)</para>
|
||||
|
||||
<para>[&arch.pc98;] Joystick port of SoundBlaster(98)
|
||||
(&man.joy.4; driver)</para>
|
||||
|
||||
<para>[&arch.i386;, &arch.pc98;] PHS Data Communication
|
||||
Card/PCCARD</para>
|
||||
<para>[&arch.i386;] PHS Data Communication Card/PCCARD</para>
|
||||
|
||||
<itemizedlist>
|
||||
<listitem>
|
||||
@ -1621,8 +1462,6 @@
|
||||
cards compatible with the HOT1 from <link xlink:href="http://www.vcc.com/">Virtual Computers</link> (xrpu
|
||||
driver).</para>
|
||||
|
||||
<para>[&arch.pc98;] Power Management Controller of NEC PC-98
|
||||
Note (pmc driver)</para>
|
||||
</sect2>
|
||||
</sect1>
|
||||
</article>
|
||||
|
@ -69,7 +69,6 @@
|
||||
<para>&os; is an operating system based on 4.4 BSD Lite for
|
||||
AMD64 and Intel EM64T based PC hardware (&arch.amd64;),
|
||||
Intel, AMD, Cyrix or NexGen <quote>x86</quote> based PC hardware (&arch.i386;),
|
||||
NEC PC-9801/9821 series PCs and compatibles (&arch.pc98;),
|
||||
and &ultrasparc; machines (&arch.sparc64;). Versions
|
||||
for the &arm; (&arch.arm;), &mips; (&arch.mips;), and
|
||||
&powerpc; (&arch.powerpc;) architectures are currently under
|
||||
@ -324,7 +323,7 @@
|
||||
</para>
|
||||
|
||||
<para>On platforms that support &man.bsdinstall.8; (currently
|
||||
&arch.amd64;, &arch.i386;, &arch.pc98;, and &arch.sparc64;), these documents are generally available via the
|
||||
&arch.amd64;, &arch.i386;, and &arch.sparc64;), these documents are generally available via the
|
||||
Documentation menu during installation. Once the system is
|
||||
installed, you can revisit this menu by re-running the
|
||||
&man.bsdinstall.8; utility.</para>
|
||||
|
@ -6,7 +6,7 @@
|
||||
# the build tree.
|
||||
#
|
||||
|
||||
ARCHS= amd64 i386 pc98 powerpc sparc64
|
||||
ARCHS= amd64 i386 powerpc sparc64
|
||||
MULTITEXTS=
|
||||
UNITEXTS= hardware readme relnotes errata
|
||||
|
||||
|
@ -36,43 +36,42 @@
|
||||
# <Driver name><tab><arch>[,<arch>...]
|
||||
#
|
||||
aac i386,amd64
|
||||
adv i386,pc98,amd64
|
||||
adw i386,pc98,amd64
|
||||
adv i386,amd64
|
||||
adw i386,amd64
|
||||
aha i386
|
||||
ahb i386
|
||||
ahd i386,sparc64,amd64
|
||||
aic i386,pc98,amd64
|
||||
amd i386,pc98,amd64
|
||||
aic i386,amd64
|
||||
amd i386,amd64
|
||||
arcmsr i386,amd64
|
||||
asr i386
|
||||
ath i386,pc98,amd64,sparc64
|
||||
aue i386,pc98,amd64,powerpc
|
||||
axe i386,pc98,amd64,powerpc
|
||||
ath i386,amd64,sparc64
|
||||
aue i386,amd64,powerpc
|
||||
axe i386,amd64,powerpc
|
||||
bce i386,amd64
|
||||
bge i386,pc98,sparc64,amd64
|
||||
bktr i386,pc98
|
||||
bge i386,sparc64,amd64
|
||||
bktr i386
|
||||
bt i386,amd64
|
||||
bxe i386,amd64
|
||||
cdce i386,pc98,amd64,powerpc
|
||||
cdce i386,amd64,powerpc
|
||||
ciss i386,amd64
|
||||
ce i386,pc98
|
||||
ce i386
|
||||
cm i386
|
||||
cnw i386,pc98,amd64
|
||||
cp i386,pc98
|
||||
ct pc98
|
||||
cnw i386,amd64
|
||||
cp i386
|
||||
ctau i386
|
||||
cue i386,pc98,amd64,powerpc
|
||||
cue i386,amd64,powerpc
|
||||
cx i386
|
||||
cxgb i386,amd64
|
||||
de i386,pc98,amd64
|
||||
de i386,amd64
|
||||
dpt i386,amd64
|
||||
ed i386,pc98
|
||||
ep i386,pc98,amd64
|
||||
ed i386
|
||||
ep i386,amd64
|
||||
esp sparc64
|
||||
ex i386,amd64
|
||||
fe i386,pc98,amd64
|
||||
fe i386,amd64
|
||||
fwohci i386,sparc64,amd64,powerpc
|
||||
hifn i386,pc98,amd64
|
||||
hifn i386,amd64
|
||||
hpt27xx i386,amd64
|
||||
hptiop i386,amd64
|
||||
hptmv i386,amd64
|
||||
@ -83,26 +82,26 @@ iir i386,amd64
|
||||
ips i386,amd64
|
||||
isci i386,amd64
|
||||
ixgb i386,amd64
|
||||
kue i386,pc98,amd64,powerpc
|
||||
lge i386,pc98,amd64
|
||||
kue i386,amd64,powerpc
|
||||
lge i386,amd64
|
||||
mfi i386,amd64
|
||||
mlx i386,amd64
|
||||
mly i386,amd64
|
||||
msk i386,amd64
|
||||
mxge i386,amd64
|
||||
my i386,pc98
|
||||
ncr i386,pc98,amd64
|
||||
ncv i386,pc98
|
||||
my i386
|
||||
ncr i386,amd64
|
||||
ncv i386
|
||||
nfe i386,amd64
|
||||
ng_bt3c i386,pc98,amd64
|
||||
ng_ubt i386,pc98,amd64
|
||||
nsp i386,pc98
|
||||
ng_bt3c i386,amd64
|
||||
ng_ubt i386,amd64
|
||||
nsp i386
|
||||
nxge i386,amd64
|
||||
oce i386,amd64
|
||||
ohci i386,pc98,amd64,powerpc
|
||||
ohci i386,amd64,powerpc
|
||||
oltr i386
|
||||
otus i386,amd64
|
||||
pcn i386,pc98,amd64
|
||||
pcn i386,amd64
|
||||
pst i386
|
||||
qlxgb amd64
|
||||
qlxgbe amd64
|
||||
@ -110,14 +109,13 @@ qlxge amd64
|
||||
rc i386
|
||||
ral i386,amd64
|
||||
rsu i386,amd64
|
||||
rue i386,pc98,amd64
|
||||
rue i386,amd64
|
||||
rum i386,amd64
|
||||
run i386,amd64
|
||||
safe i386,pc98,amd64
|
||||
safe i386,amd64
|
||||
sbp i386,sparc64,amd64
|
||||
sfgxe amd64
|
||||
sn i386,amd64
|
||||
snc pc98
|
||||
snd_ad1816 i386,amd64
|
||||
snd_als4000 i386
|
||||
snd_atiixp i386,amd64
|
||||
@ -148,31 +146,31 @@ snd_t4dwave i386,amd64,sparc64
|
||||
snd_via8233 i386,amd64
|
||||
snd_via82c686 i386,amd64
|
||||
snd_vibes i386,amd64
|
||||
stg i386,pc98
|
||||
ti i386,pc98,amd64,sparc64
|
||||
tl i386,pc98,amd64
|
||||
stg i386
|
||||
ti i386,amd64,sparc64
|
||||
tl i386,amd64
|
||||
trm i386,amd64
|
||||
twa i386,amd64
|
||||
twe i386,amd64
|
||||
tws i386,amd64
|
||||
ubsa i386,pc98,amd64
|
||||
ubsec i386,pc98,amd64
|
||||
ubser i386,pc98,amd64
|
||||
ucycom i386,pc98,amd64
|
||||
udav i386,pc98,amd64
|
||||
uftdi i386,pc98,amd64
|
||||
uhci i386,pc98,amd64,powerpc
|
||||
ulpt i386,pc98,amd64,powerpc
|
||||
umass i386,pc98,amd64,powerpc
|
||||
umodem i386,pc98,amd64
|
||||
uplcom i386,pc98,amd64
|
||||
ubsa i386,amd64
|
||||
ubsec i386,amd64
|
||||
ubser i386,amd64
|
||||
ucycom i386,amd64
|
||||
udav i386,amd64
|
||||
uftdi i386,amd64
|
||||
uhci i386,amd64,powerpc
|
||||
ulpt i386,amd64,powerpc
|
||||
umass i386,amd64,powerpc
|
||||
umodem i386,amd64
|
||||
uplcom i386,amd64
|
||||
ural i386,amd64
|
||||
urio i386,pc98,amd64,powerpc
|
||||
uvisor i386,pc98,amd64
|
||||
uvscom i386,pc98,amd64
|
||||
urio i386,amd64,powerpc
|
||||
uvisor i386,amd64
|
||||
uvscom i386,amd64
|
||||
vpo i386
|
||||
vx i386,pc98,amd64
|
||||
vx i386,amd64
|
||||
vxge i386,amd64
|
||||
wb i386,pc98,amd64
|
||||
wb i386,amd64
|
||||
xe i386,amd64
|
||||
zyd i386,amd64
|
||||
|
@ -73,7 +73,6 @@
|
||||
<!ENTITY arch.arm64 "aarch64">
|
||||
<!ENTITY arch.i386 "i386">
|
||||
<!ENTITY arch.mips "mips">
|
||||
<!ENTITY arch.pc98 "pc98">
|
||||
<!ENTITY arch.powerpc "powerpc">
|
||||
<!ENTITY arch.powerpc64 "powerpc64">
|
||||
<!ENTITY arch.sparc64 "sparc64">
|
||||
|
@ -1,45 +0,0 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Module: mkisoimages.sh
|
||||
# Author: Jordan K Hubbard
|
||||
# Date: 22 June 2001
|
||||
#
|
||||
# $FreeBSD$
|
||||
#
|
||||
# This script is used by release/Makefile to build the (optional) ISO images
|
||||
# for a FreeBSD release. It is considered architecture dependent since each
|
||||
# platform has a slightly unique way of making bootable CDs. This script
|
||||
# is also allowed to generate any number of images since that is more of
|
||||
# publishing decision than anything else.
|
||||
#
|
||||
# Usage:
|
||||
#
|
||||
# mkisoimages.sh [-b] image-label image-name base-bits-dir [extra-bits-dir]
|
||||
#
|
||||
# Where -b is passed if the ISO image should be made "bootable" by
|
||||
# whatever standards this architecture supports (may be unsupported),
|
||||
# image-label is the ISO image label, image-name is the filename of the
|
||||
# resulting ISO image, base-bits-dir contains the image contents and
|
||||
# extra-bits-dir, if provided, contains additional files to be merged
|
||||
# into base-bits-dir as part of making the image.
|
||||
|
||||
if [ "x$1" = "x-b" ]; then
|
||||
# This is highly x86-centric and will be used directly below.
|
||||
bootable="-o generic-bootimage=$4/boot/cdboot"
|
||||
shift
|
||||
else
|
||||
bootable=""
|
||||
fi
|
||||
|
||||
if [ $# -lt 3 ]; then
|
||||
echo "Usage: $0 [-b] image-label image-name base-bits-dir [extra-bits-dir]"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
LABEL=`echo "$1" | tr '[:lower:]' '[:upper:]'`; shift
|
||||
NAME="$1"; shift
|
||||
|
||||
publisher="The FreeBSD Project. http://www.FreeBSD.org/"
|
||||
echo "/dev/iso9660/$LABEL / cd9660 ro 0 0" > "$1/etc/fstab"
|
||||
makefs -t cd9660 $bootable -o rockridge -o label="$LABEL" -o publisher="$publisher" "$NAME" "$@"
|
||||
rm -f "$1/etc/fstab"
|
@ -16,11 +16,7 @@ mkdir /tmp/bsdinstall_etc
|
||||
kbdcontrol -d >/dev/null 2>&1
|
||||
if [ $? -eq 0 ]; then
|
||||
# Syscons: use xterm, start interesting things on other VTYs
|
||||
if [ ${MACHINE} = "pc98" ]; then
|
||||
TERM=cons25w
|
||||
else
|
||||
TERM=xterm
|
||||
fi
|
||||
TERM=xterm
|
||||
|
||||
# Don't send ESC on function-key 62/63 (left/right command key)
|
||||
kbdcontrol -f 62 '' > /dev/null 2>&1
|
||||
|
@ -141,10 +141,6 @@ CRUNCH_ALIAS_bsdlabel= disklabel
|
||||
#CRUNCH_LIBS+= -lsmb
|
||||
.endif
|
||||
|
||||
.if ${MACHINE} == "pc98"
|
||||
CRUNCH_SRCDIR_fdisk= $(.CURDIR)/../../sbin/fdisk_pc98
|
||||
.endif
|
||||
|
||||
.if ${MACHINE_CPUARCH} == "sparc64"
|
||||
CRUNCH_PROGS_sbin+= bsdlabel sunlabel
|
||||
.endif
|
||||
|
@ -1,5 +0,0 @@
|
||||
# $FreeBSD$
|
||||
|
||||
SUBDIR += bsdlabel
|
||||
SUBDIR += fdisk_pc98
|
||||
SUBDIR += sconfig
|
@ -109,9 +109,9 @@ argument forces
|
||||
.Nm
|
||||
to use a layout suitable for a different architecture.
|
||||
Current valid values are
|
||||
.Cm i386 , amd64 ,
|
||||
.Cm i386
|
||||
and
|
||||
.Cm pc98 .
|
||||
.Cm amd64 .
|
||||
If this option is omitted,
|
||||
.Nm
|
||||
will use a layout suitable for the current machine.
|
||||
|
@ -164,8 +164,7 @@ main(int argc, char *argv[])
|
||||
break;
|
||||
case 'm':
|
||||
if (!strcmp(optarg, "i386") ||
|
||||
!strcmp(optarg, "amd64") ||
|
||||
!strcmp(optarg, "pc98")) {
|
||||
!strcmp(optarg, "amd64")) {
|
||||
labelsoffset = 1;
|
||||
labeloffset = 0;
|
||||
bbsize = 8192;
|
||||
|
@ -1,13 +0,0 @@
|
||||
# $FreeBSD$
|
||||
|
||||
PACKAGE=runtime
|
||||
PROG= fdisk
|
||||
SRCS= fdisk.c geom_pc98_enc.c
|
||||
WARNS?= 4
|
||||
MAN= fdisk.8
|
||||
|
||||
.PATH: ${.CURDIR}/../../sys/geom
|
||||
|
||||
LIBADD= geom
|
||||
|
||||
.include <bsd.prog.mk>
|
@ -1,17 +0,0 @@
|
||||
# $FreeBSD$
|
||||
# Autogenerated - do NOT edit!
|
||||
|
||||
DIRDEPS = \
|
||||
gnu/lib/libgcc \
|
||||
include \
|
||||
include/xlocale \
|
||||
lib/${CSU_DIR} \
|
||||
lib/libc \
|
||||
lib/libgeom \
|
||||
|
||||
|
||||
.include <dirdeps.mk>
|
||||
|
||||
.if ${DEP_RELDIR} == ${_DEP_RELDIR}
|
||||
# local dependencies - needed for -jN in clean tree
|
||||
.endif
|
@ -1,486 +0,0 @@
|
||||
.\" $FreeBSD$
|
||||
.\"
|
||||
.Dd October 5, 2016
|
||||
.Dt FDISK 8
|
||||
.Os
|
||||
.Sh NAME
|
||||
.Nm fdisk
|
||||
.Nd NEC PC-98x1 slice table maintenance utility
|
||||
.Sh SYNOPSIS
|
||||
.Nm
|
||||
.Op Fl BIaistuv
|
||||
.Op Fl 12345678
|
||||
.Op Ar disk
|
||||
.Nm
|
||||
.Fl f Ar configfile
|
||||
.Op Fl itv
|
||||
.Op Ar disk
|
||||
.Sh PROLOGUE
|
||||
In order for the BIOS to boot the kernel,
|
||||
certain conventions must be adhered to.
|
||||
Sector 0 of the disk must contain boot code,
|
||||
a slice table,
|
||||
and a magic number.
|
||||
BIOS slices can be used to break the disk up into several pieces.
|
||||
The BIOS brings in sector 0 and verifies the magic number.
|
||||
The sector
|
||||
0 boot code then searches the slice table to determine which
|
||||
slice is marked
|
||||
.Dq active .
|
||||
This boot code then brings in the bootstrap from the
|
||||
active slice and, if marked bootable, runs it.
|
||||
Under
|
||||
.Tn DOS ,
|
||||
you can have one or more slices with one active.
|
||||
The
|
||||
.Tn DOS
|
||||
.Nm
|
||||
utility can be used to divide space on the disk into slices and set one
|
||||
active.
|
||||
.Sh DESCRIPTION
|
||||
The
|
||||
.Fx
|
||||
utility,
|
||||
.Nm ,
|
||||
serves a similar purpose to the
|
||||
.Tn DOS
|
||||
utility.
|
||||
The first form is used to
|
||||
display slice information or to interactively edit the slice
|
||||
table.
|
||||
The second is used to write a slice table using a
|
||||
.Ar configfile ,
|
||||
and is designed to be used by other scripts/programs.
|
||||
.Pp
|
||||
Options are:
|
||||
.Bl -tag -width indent
|
||||
.It Fl a
|
||||
Change the active slice only.
|
||||
Ignored if
|
||||
.Fl f
|
||||
is given.
|
||||
.It Fl B
|
||||
Reinitialize the boot code contained in sector 0 of the disk.
|
||||
Ignored if
|
||||
.Fl f
|
||||
is given.
|
||||
.It Fl f Ar configfile
|
||||
Set slice values using the file
|
||||
.Ar configfile .
|
||||
The
|
||||
.Ar configfile
|
||||
always modifies existing slices, unless
|
||||
.Fl i
|
||||
is also given, in which case all existing slices are deleted (marked
|
||||
as
|
||||
.Dq unused )
|
||||
before the
|
||||
.Ar configfile
|
||||
is read.
|
||||
The
|
||||
.Ar configfile
|
||||
can be
|
||||
.Sq Fl ,
|
||||
in which case standard input is read.
|
||||
See
|
||||
.Sx CONFIGURATION FILE ,
|
||||
below, for file syntax.
|
||||
.Pp
|
||||
.Em WARNING :
|
||||
when
|
||||
.Fl f
|
||||
is used, you are not asked if you really want to write the slices
|
||||
table (as you are in the interactive mode).
|
||||
Use with caution!
|
||||
.It Fl i
|
||||
Initialize sector 0 of the disk.
|
||||
This implies
|
||||
.Fl u ,
|
||||
unless
|
||||
.Fl f
|
||||
is given.
|
||||
.It Fl I
|
||||
Initialize sector 0 slice table
|
||||
for one
|
||||
.Fx
|
||||
slice covering the entire disk.
|
||||
Some space at the start of the disk will reserved for the IPL program
|
||||
and the pc98 slice table itself.
|
||||
.It Fl s
|
||||
Print summary information and exit.
|
||||
.It Fl t
|
||||
Test mode; do not write slice values.
|
||||
Generally used with the
|
||||
.Fl f
|
||||
option to see what would be written to the slice table.
|
||||
Implies
|
||||
.Fl v .
|
||||
.It Fl u
|
||||
Update (edit) the disk's sector 0 slice table.
|
||||
Ignored if
|
||||
.Fl f
|
||||
is given.
|
||||
.It Fl v
|
||||
Be verbose.
|
||||
Slices that are unused are suppressed unless this flag is specified.
|
||||
When
|
||||
.Fl f
|
||||
is used,
|
||||
.Nm
|
||||
prints out the slice table that is written to the disk.
|
||||
.It Fl 12345678
|
||||
Operate on a single slice table entry only.
|
||||
Ignored if
|
||||
.Fl f
|
||||
is given.
|
||||
.El
|
||||
.Pp
|
||||
The final disk name can be provided as a
|
||||
.Dq bare
|
||||
disk name only, e.g.\&
|
||||
.Pa da0 ,
|
||||
or as a full pathname.
|
||||
If omitted,
|
||||
.Nm
|
||||
tries to figure out the default disk device name from the
|
||||
mounted root device.
|
||||
.Pp
|
||||
When called with no arguments, it prints the sector 0 slice table.
|
||||
An example follows:
|
||||
.Bd -literal
|
||||
******* Working on device /dev/da0 *******
|
||||
parameters extracted from in-core disklabel are:
|
||||
cylinders=33075 heads=8 sectors/track=32 (256 blks/cyl)
|
||||
|
||||
parameters to be used for BIOS calculations are:
|
||||
cylinders=33075 heads=8 sectors/track=32 (256 blks/cyl)
|
||||
|
||||
Media sector size is 512
|
||||
Warning: BIOS sector numbering starts with sector 1
|
||||
Information from DOS bootblock is:
|
||||
The data for partition 1 is:
|
||||
sysmid 148,(FreeBSD/NetBSD/386BSD)
|
||||
start 256, size 2490112 (1215 Meg), sid 196
|
||||
beg: cyl 1/ sector 0/ head 0;
|
||||
end: cyl 9727/ sector 0/ head 0
|
||||
system Name FreeBSD(98)
|
||||
The data for partition 2 is:
|
||||
sysmid 148,(FreeBSD/NetBSD/386BSD)
|
||||
start 2490368, size 5505024 (2688 Meg), sid 196
|
||||
beg: cyl 9728/ sector 0/ head 0;
|
||||
end: cyl 31231/ sector 0/ head 0
|
||||
system Name FreeBSD(98)
|
||||
The data for partition 3 is:
|
||||
<UNUSED>
|
||||
The data for partition 4 is:
|
||||
<UNUSED>
|
||||
The data for partition 5 is:
|
||||
<UNUSED>
|
||||
The data for partition 6 is:
|
||||
<UNUSED>
|
||||
The data for partition 7 is:
|
||||
<UNUSED>
|
||||
The data for partition 8 is:
|
||||
<UNUSED>
|
||||
The data for partition 9 is:
|
||||
<UNUSED>
|
||||
The data for partition 10 is:
|
||||
<UNUSED>
|
||||
The data for partition 11 is:
|
||||
<UNUSED>
|
||||
The data for partition 12 is:
|
||||
<UNUSED>
|
||||
The data for partition 13 is:
|
||||
<UNUSED>
|
||||
The data for partition 14 is:
|
||||
<UNUSED>
|
||||
The data for partition 15 is:
|
||||
<UNUSED>
|
||||
The data for partition 16 is:
|
||||
<UNUSED>
|
||||
.Ed
|
||||
.Pp
|
||||
The disk is divided into three slices that happen to fill the disk.
|
||||
The second slice overlaps the end of the first.
|
||||
(Used for debugging purposes.)
|
||||
.Bl -tag -width ".Em cyl , sector No and Em head"
|
||||
.It Em sysmid
|
||||
is used to label the slice.
|
||||
.Fx
|
||||
reserves the
|
||||
magic number 148 decimal (94 in hex).
|
||||
.It Xo
|
||||
.Em start
|
||||
and
|
||||
.Em size
|
||||
.Xc
|
||||
fields provide the start address
|
||||
and size of a slice in sectors.
|
||||
.It Xo
|
||||
.Em cyl , sector
|
||||
and
|
||||
.Em head
|
||||
.Xc
|
||||
fields are used to specify the beginning and end addresses of the slice.
|
||||
.It Em "system Name"
|
||||
is the name of the slice.
|
||||
.El
|
||||
.Pp
|
||||
.Em Note :
|
||||
these numbers are calculated using BIOS's understanding of the disk geometry
|
||||
and saved in the bootblock.
|
||||
.Pp
|
||||
The
|
||||
.Fl i
|
||||
and
|
||||
.Fl u
|
||||
flags are used to indicate that the slice data is to be updated.
|
||||
Unless the
|
||||
.Fl f
|
||||
option is also given,
|
||||
.Nm
|
||||
will enter a conversational mode.
|
||||
In this mode, no changes will be written to disk unless you explicitly tell
|
||||
.Nm
|
||||
to.
|
||||
.Pp
|
||||
The
|
||||
.Nm
|
||||
utility will display each slice and ask whether you want to edit it.
|
||||
If you say yes,
|
||||
.Nm
|
||||
will step through each field, show you the old value,
|
||||
and ask you for a new one.
|
||||
When you are done with the slice,
|
||||
.Nm
|
||||
will display it and ask you whether it is correct.
|
||||
It will then proceed to the next entry.
|
||||
.Pp
|
||||
Getting the
|
||||
.Em cyl , sector ,
|
||||
and
|
||||
.Em head
|
||||
fields correct is tricky, so by default,
|
||||
they will be calculated for you;
|
||||
you can specify them if you choose to though.
|
||||
.Pp
|
||||
After all the slices are processed,
|
||||
you are given the option to change the
|
||||
.Dq active
|
||||
slice.
|
||||
Finally, when all the new data for sector 0 has been accumulated,
|
||||
you are asked to confirm whether you really want to rewrite it.
|
||||
.Pp
|
||||
The difference between the
|
||||
.Fl u
|
||||
and
|
||||
.Fl i
|
||||
flags is that
|
||||
the
|
||||
.Fl u
|
||||
flag edits (updates) the existing slice parameters
|
||||
while the
|
||||
.Fl i
|
||||
flag is used to
|
||||
.Dq initialize
|
||||
them (old values will be ignored);
|
||||
it will setup the last BIOS slice to use the whole disk for
|
||||
.Fx ;
|
||||
and make it active.
|
||||
.Sh NOTES
|
||||
The automatic calculation of starting cylinder etc.\& uses
|
||||
a set of figures that represent what the BIOS thinks the
|
||||
geometry of the drive is.
|
||||
These figures are taken from the in-core disklabel by default,
|
||||
but
|
||||
.Nm
|
||||
initially gives you an opportunity to change them.
|
||||
This allows you to create a bootblock that can work with drives
|
||||
that use geometry translation under the BIOS.
|
||||
.Pp
|
||||
If you hand craft your disk layout,
|
||||
please make sure that the
|
||||
.Fx
|
||||
slice starts on a cylinder boundary.
|
||||
.Pp
|
||||
Editing an existing slice will most likely result in the loss of
|
||||
all data in that slice.
|
||||
.Pp
|
||||
You should run
|
||||
.Nm
|
||||
interactively once or twice to see how it works.
|
||||
This is completely safe as long as you answer the last question
|
||||
in the negative.
|
||||
There are subtleties that
|
||||
.Nm
|
||||
detects that are not fully explained in this manual page.
|
||||
.Sh CONFIGURATION FILE
|
||||
When the
|
||||
.Fl f
|
||||
option is given, a disk's slice table can be written using values
|
||||
from a
|
||||
.Ar configfile .
|
||||
The syntax of this file is very simple;
|
||||
each line is either a comment or a specification, as follows:
|
||||
.Bl -tag -width indent
|
||||
.It Ic # Ar comment ...
|
||||
Lines beginning with a
|
||||
.Ic #
|
||||
are comments and are ignored.
|
||||
.It Ic g Ar spec1 spec2 spec3
|
||||
Set the BIOS geometry used in slice calculations.
|
||||
There must be
|
||||
three values specified, with a letter preceding each number:
|
||||
.Bl -tag -width indent
|
||||
.It Cm c Ns Ar num
|
||||
Set the number of cylinders to
|
||||
.Ar num .
|
||||
.It Cm h Ns Ar num
|
||||
Set the number of heads to
|
||||
.Ar num .
|
||||
.It Cm s Ns Ar num
|
||||
Set the number of sectors/track to
|
||||
.Ar num .
|
||||
.El
|
||||
.Pp
|
||||
These specs can occur in any order, as the leading letter determines
|
||||
which value is which; however, all three must be specified.
|
||||
.Pp
|
||||
This line must occur before any lines that specify slice
|
||||
information.
|
||||
.Pp
|
||||
It is an error if the following is not true:
|
||||
.Bd -literal -offset indent
|
||||
1 <= number of cylinders
|
||||
1 <= number of heads <= 256
|
||||
1 <= number of sectors/track < 64
|
||||
.Ed
|
||||
.Pp
|
||||
The number of cylinders should be less than or equal to 1024, but this
|
||||
is not enforced, although a warning will be printed.
|
||||
Note that bootable
|
||||
.Fx
|
||||
slices (the
|
||||
.Dq Pa /
|
||||
file system) must lie completely within the
|
||||
first 1024 cylinders; if this is not true, booting may fail.
|
||||
Non-bootable slices do not have this restriction.
|
||||
.Pp
|
||||
Example (all of these are equivalent), for a disk with 1019 cylinders,
|
||||
39 heads, and 63 sectors:
|
||||
.Bd -literal -offset indent
|
||||
g c1019 h39 s63
|
||||
g h39 c1019 s63
|
||||
g s63 h39 c1019
|
||||
.Ed
|
||||
.It Ic p Ar slice type start length
|
||||
Set the slice given by
|
||||
.Ar slice
|
||||
(1-8) to type
|
||||
.Ar type ,
|
||||
starting at sector
|
||||
.Ar start
|
||||
for
|
||||
.Ar length
|
||||
sectors.
|
||||
.Pp
|
||||
Only those slices explicitly mentioned by these lines are modified;
|
||||
any slice not referenced by a
|
||||
.Ic p
|
||||
line will not be modified.
|
||||
However, if an invalid slice table is present, or the
|
||||
.Fl i
|
||||
option is specified, all existing slice entries will be cleared
|
||||
(marked as unused), and these
|
||||
.Ic p
|
||||
lines will have to be used to
|
||||
explicitly set slice information.
|
||||
If multiple slices need to be
|
||||
set, multiple
|
||||
.Ic p
|
||||
lines must be specified; one for each slice.
|
||||
.Pp
|
||||
These slice lines must occur after any geometry specification lines,
|
||||
if one is present.
|
||||
.Pp
|
||||
The
|
||||
.Ar type
|
||||
is 165 for
|
||||
.Fx
|
||||
slices.
|
||||
Specifying a slice type of zero is
|
||||
the same as clearing the slice and marking it as unused; however,
|
||||
dummy values (such as
|
||||
.Dq 0 )
|
||||
must still be specified for
|
||||
.Ar start
|
||||
and
|
||||
.Ar length .
|
||||
.Pp
|
||||
Note: the start offset will be rounded upwards to a head boundary if
|
||||
necessary, and the end offset will be rounded downwards to a cylinder
|
||||
boundary if necessary.
|
||||
.Pp
|
||||
Example: to clear slice 4 and mark it as unused:
|
||||
.Pp
|
||||
.Dl "p 4 0 0 0"
|
||||
.Pp
|
||||
Example: to set slice 1 to a
|
||||
.Fx
|
||||
slice, starting at sector 1
|
||||
for 2503871 sectors (note: these numbers will be rounded upwards and
|
||||
downwards to correspond to head and cylinder boundaries):
|
||||
.Pp
|
||||
.Dl "p 1 165 1 2503871"
|
||||
.It Ic a Ar slice
|
||||
Make
|
||||
.Ar slice
|
||||
the active slice.
|
||||
Can occur anywhere in the config file, but only
|
||||
one must be present.
|
||||
.Pp
|
||||
Example: to make slice 1 the active slice:
|
||||
.Pp
|
||||
.Dl "a 1"
|
||||
.El
|
||||
.Sh SEE ALSO
|
||||
.Xr boot98cfg 8 ,
|
||||
.Xr bsdlabel 8 ,
|
||||
.Xr gpart 8 ,
|
||||
.Xr newfs 8
|
||||
.Sh HISTORY
|
||||
A version of
|
||||
.Nm
|
||||
first appeared in the Mach Operating System.
|
||||
It was subsequently ported to
|
||||
.Bx 386 .
|
||||
.Sh AUTHORS
|
||||
.An -nosplit
|
||||
.Nm
|
||||
for Mach Operating System was written by
|
||||
.An Robert Baron Aq Mt rvb@cs.cmu.edu .
|
||||
It was ported to
|
||||
.Bx 386
|
||||
by
|
||||
.An Julian Elischer Aq Mt julian@tfs.com .
|
||||
.Sh BUGS
|
||||
The default boot code will not necessarily handle all slice types
|
||||
correctly, in particular those introduced since
|
||||
.Tn MS-DOS
|
||||
6.x.
|
||||
.Pp
|
||||
The entire utility should be made more user-friendly.
|
||||
.Pp
|
||||
Most users new to
|
||||
.Fx
|
||||
do not understand the difference between
|
||||
.Dq slice
|
||||
and
|
||||
.Dq partition ,
|
||||
causing difficulty to adjust.
|
||||
.Pp
|
||||
You cannot use this command to completely dedicate a disk to
|
||||
.Fx .
|
||||
The
|
||||
.Xr bsdlabel 8
|
||||
command must be used for this.
|
@ -1,910 +0,0 @@
|
||||
/*
|
||||
* Mach Operating System
|
||||
* Copyright (c) 1992 Carnegie Mellon University
|
||||
* All Rights Reserved.
|
||||
*
|
||||
* Permission to use, copy, modify and distribute this software and its
|
||||
* documentation is hereby granted, provided that both the copyright
|
||||
* notice and this permission notice appear in all copies of the
|
||||
* software, derivative works or modified versions, and any portions
|
||||
* thereof, and that both notices appear in supporting documentation.
|
||||
*
|
||||
* CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
|
||||
* CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
|
||||
* ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
|
||||
*
|
||||
* Carnegie Mellon requests users of this software to return to
|
||||
*
|
||||
* Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
|
||||
* School of Computer Science
|
||||
* Carnegie Mellon University
|
||||
* Pittsburgh PA 15213-3890
|
||||
*
|
||||
* any improvements or extensions that they make and grant Carnegie Mellon
|
||||
* the rights to redistribute these changes.
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__FBSDID("$FreeBSD$");
|
||||
|
||||
#include <sys/disk.h>
|
||||
#include <sys/disklabel.h>
|
||||
#include <sys/diskpc98.h>
|
||||
#include <sys/param.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/mount.h>
|
||||
#include <ctype.h>
|
||||
#include <fcntl.h>
|
||||
#include <err.h>
|
||||
#include <errno.h>
|
||||
#include <libgeom.h>
|
||||
#include <paths.h>
|
||||
#include <regex.h>
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
|
||||
int iotest;
|
||||
|
||||
#define LBUF 100
|
||||
static char lbuf[LBUF];
|
||||
|
||||
/*
|
||||
*
|
||||
* Ported to 386bsd by Julian Elischer Thu Oct 15 20:26:46 PDT 1992
|
||||
*
|
||||
* 14-Dec-89 Robert Baron (rvb) at Carnegie-Mellon University
|
||||
* Copyright (c) 1989 Robert. V. Baron
|
||||
* Created.
|
||||
*/
|
||||
|
||||
#define Decimal(str, ans, tmp) if (decimal(str, &tmp, ans)) ans = tmp
|
||||
#define String(str, ans, len) {char *z = ans; char **dflt = &z; if (string(str, dflt)) strncpy(ans, *dflt, len); }
|
||||
|
||||
#define MAX_SEC_SIZE 2048 /* maximum section size that is supported */
|
||||
#define MIN_SEC_SIZE 512 /* the sector size to start sensing at */
|
||||
static int secsize = 0; /* the sensed sector size */
|
||||
|
||||
static char *disk;
|
||||
|
||||
static int cyls, sectors, heads, cylsecs, disksecs;
|
||||
|
||||
struct mboot {
|
||||
unsigned char padding[2]; /* force the longs to be long aligned */
|
||||
unsigned char bootinst[510];
|
||||
unsigned short int signature;
|
||||
struct pc98_partition parts[8];
|
||||
unsigned char large_sector_overflow[MAX_SEC_SIZE-MIN_SEC_SIZE];
|
||||
};
|
||||
|
||||
static struct mboot mboot;
|
||||
static int fd;
|
||||
|
||||
static uint dos_cyls;
|
||||
static uint dos_heads;
|
||||
static uint dos_sectors;
|
||||
static uint dos_cylsecs;
|
||||
|
||||
#define MAX_ARGS 10
|
||||
|
||||
typedef struct cmd {
|
||||
char cmd;
|
||||
int n_args;
|
||||
struct arg {
|
||||
char argtype;
|
||||
int arg_val;
|
||||
} args[MAX_ARGS];
|
||||
} CMD;
|
||||
|
||||
static int B_flag = 0; /* replace boot code */
|
||||
static int I_flag = 0; /* Inizialize disk to defaults */
|
||||
static int a_flag = 0; /* set active partition */
|
||||
static int i_flag = 0; /* replace partition data */
|
||||
static int u_flag = 0; /* update partition data */
|
||||
static int s_flag = 0; /* Print a summary and exit */
|
||||
static int t_flag = 0; /* test only */
|
||||
static char *f_flag = NULL; /* Read config info from file */
|
||||
static int v_flag = 0; /* Be verbose */
|
||||
|
||||
static struct part_type
|
||||
{
|
||||
unsigned char type;
|
||||
const char *name;
|
||||
} part_types[] = {
|
||||
{0x00, "unused"}
|
||||
,{0x01, "Primary DOS with 12 bit FAT"}
|
||||
,{0x11, "MSDOS"}
|
||||
,{0x20, "MSDOS"}
|
||||
,{0x21, "MSDOS"}
|
||||
,{0x22, "MSDOS"}
|
||||
,{0x23, "MSDOS"}
|
||||
,{0x02, "XENIX / file system"}
|
||||
,{0x03, "XENIX /usr file system"}
|
||||
,{0x04, "PC-UX"}
|
||||
,{0x05, "Extended DOS"}
|
||||
,{0x06, "Primary 'big' DOS (> 32MB)"}
|
||||
,{0x07, "OS/2 HPFS, QNX or Advanced UNIX"}
|
||||
,{0x08, "AIX file system"}
|
||||
,{0x09, "AIX boot partition or Coherent"}
|
||||
,{0x0A, "OS/2 Boot Manager or OPUS"}
|
||||
,{0x10, "OPUS"}
|
||||
,{0x14, "FreeBSD/NetBSD/386BSD"}
|
||||
,{0x94, "FreeBSD/NetBSD/386BSD"}
|
||||
,{0x40, "VENIX 286"}
|
||||
,{0x50, "DM"}
|
||||
,{0x51, "DM"}
|
||||
,{0x52, "CP/M or Microport SysV/AT"}
|
||||
,{0x56, "GB"}
|
||||
,{0x61, "Speed"}
|
||||
,{0x63, "ISC UNIX, other System V/386, GNU HURD or Mach"}
|
||||
,{0x64, "Novell Netware 2.xx"}
|
||||
,{0x65, "Novell Netware 3.xx"}
|
||||
,{0x75, "PCIX"}
|
||||
,{0x40, "Minix"}
|
||||
};
|
||||
|
||||
static void print_s0(int which);
|
||||
static void print_part(int i);
|
||||
static void init_sector0(unsigned long start);
|
||||
static void init_boot(void);
|
||||
static void change_part(int i, int force);
|
||||
static void print_params(void);
|
||||
static void change_active(int which);
|
||||
static void change_code(void);
|
||||
static void get_params_to_use(void);
|
||||
static char *get_rootdisk(void);
|
||||
static void dos(u_int32_t start, u_int32_t size, struct pc98_partition *partp);
|
||||
static int open_disk(int flag);
|
||||
static ssize_t read_disk(off_t sector, void *buf);
|
||||
static int write_disk(off_t sector, void *buf);
|
||||
static int get_params(void);
|
||||
static int read_s0(void);
|
||||
static int write_s0(void);
|
||||
static int ok(const char *str);
|
||||
static int decimal(const char *str, int *num, int deflt);
|
||||
static const char *get_type(int type);
|
||||
static void usage(void);
|
||||
static int string(const char *str, char **ans);
|
||||
static void reset_boot(void);
|
||||
|
||||
int
|
||||
main(int argc, char *argv[])
|
||||
{
|
||||
struct stat sb;
|
||||
int c, i;
|
||||
int partition = -1;
|
||||
struct pc98_partition *partp;
|
||||
|
||||
while ((c = getopt(argc, argv, "BIa:f:istuv12345678")) != -1)
|
||||
switch (c) {
|
||||
case 'B':
|
||||
B_flag = 1;
|
||||
break;
|
||||
case 'I':
|
||||
I_flag = 1;
|
||||
break;
|
||||
case 'a':
|
||||
a_flag = 1;
|
||||
break;
|
||||
case 'f':
|
||||
f_flag = optarg;
|
||||
break;
|
||||
case 'i':
|
||||
i_flag = 1;
|
||||
break;
|
||||
case 's':
|
||||
s_flag = 1;
|
||||
break;
|
||||
case 't':
|
||||
t_flag = 1;
|
||||
break;
|
||||
case 'u':
|
||||
u_flag = 1;
|
||||
break;
|
||||
case 'v':
|
||||
v_flag = 1;
|
||||
break;
|
||||
case '1':
|
||||
case '2':
|
||||
case '3':
|
||||
case '4':
|
||||
case '5':
|
||||
case '6':
|
||||
case '7':
|
||||
case '8':
|
||||
partition = c - '0';
|
||||
break;
|
||||
default:
|
||||
usage();
|
||||
}
|
||||
if (f_flag || i_flag)
|
||||
u_flag = 1;
|
||||
if (t_flag)
|
||||
v_flag = 1;
|
||||
argc -= optind;
|
||||
argv += optind;
|
||||
|
||||
if (argc == 0) {
|
||||
disk = get_rootdisk();
|
||||
} else {
|
||||
if (stat(argv[0], &sb) == 0) {
|
||||
/* OK, full pathname given */
|
||||
disk = argv[0];
|
||||
} else if (errno == ENOENT && argv[0][0] != '/') {
|
||||
/* Try prepending "/dev" */
|
||||
asprintf(&disk, "%s%s", _PATH_DEV, argv[0]);
|
||||
if (disk == NULL)
|
||||
errx(1, "out of memory");
|
||||
} else {
|
||||
/* other stat error, let it fail below */
|
||||
disk = argv[0];
|
||||
}
|
||||
}
|
||||
if (open_disk(u_flag) < 0)
|
||||
err(1, "cannot open disk %s", disk);
|
||||
|
||||
if (s_flag) {
|
||||
if (read_s0())
|
||||
err(1, "read_s0");
|
||||
printf("%s: %d cyl %d hd %d sec\n", disk, dos_cyls, dos_heads,
|
||||
dos_sectors);
|
||||
printf("Part %11s %11s %4s %4s %-16s\n", "Start", "Size", "MID",
|
||||
"SID", "Name");
|
||||
for (i = 0; i < PC98_NPARTS; i++) {
|
||||
partp = ((struct pc98_partition *) &mboot.parts) + i;
|
||||
if (partp->dp_sid == 0)
|
||||
continue;
|
||||
printf("%4d: %11u %11u 0x%02x 0x%02x %-16.16s\n", i + 1,
|
||||
partp->dp_scyl * cylsecs,
|
||||
(partp->dp_ecyl - partp->dp_scyl + 1) * cylsecs,
|
||||
partp->dp_mid, partp->dp_sid, partp->dp_name);
|
||||
}
|
||||
exit(0);
|
||||
}
|
||||
|
||||
printf("******* Working on device %s *******\n",disk);
|
||||
|
||||
if (I_flag) {
|
||||
read_s0();
|
||||
reset_boot();
|
||||
partp = (struct pc98_partition *) (&mboot.parts[0]);
|
||||
partp->dp_mid = DOSMID_386BSD;
|
||||
partp->dp_sid = DOSSID_386BSD;
|
||||
strncpy(partp->dp_name, "FreeBSD", sizeof(partp->dp_name));
|
||||
/* Start c/h/s. */
|
||||
partp->dp_scyl = partp->dp_ipl_cyl = 1;
|
||||
partp->dp_shd = partp->dp_ipl_head = 1;
|
||||
partp->dp_ssect = partp->dp_ipl_sct = 0;
|
||||
|
||||
/* End c/h/s. */
|
||||
partp->dp_ecyl = dos_cyls - 1;
|
||||
partp->dp_ehd = dos_cylsecs / dos_sectors;
|
||||
partp->dp_esect = dos_sectors;
|
||||
|
||||
if (v_flag)
|
||||
print_s0(-1);
|
||||
if (!t_flag)
|
||||
write_s0();
|
||||
exit(0);
|
||||
}
|
||||
|
||||
if (f_flag) {
|
||||
if (v_flag)
|
||||
print_s0(-1);
|
||||
if (!t_flag)
|
||||
write_s0();
|
||||
} else {
|
||||
if(u_flag)
|
||||
get_params_to_use();
|
||||
else
|
||||
print_params();
|
||||
|
||||
if (read_s0())
|
||||
init_sector0(dos_sectors);
|
||||
|
||||
printf("Media sector size is %d\n", secsize);
|
||||
printf("Warning: BIOS sector numbering starts with sector 1\n");
|
||||
printf("Information from DOS bootblock is:\n");
|
||||
if (partition == -1)
|
||||
for (i = 1; i <= PC98_NPARTS; i++)
|
||||
change_part(i, v_flag);
|
||||
else
|
||||
change_part(partition, 1);
|
||||
|
||||
if (u_flag || a_flag)
|
||||
change_active(partition);
|
||||
|
||||
if (B_flag)
|
||||
change_code();
|
||||
|
||||
if (u_flag || a_flag || B_flag) {
|
||||
if (!t_flag) {
|
||||
printf("\nWe haven't changed the partition table yet. ");
|
||||
printf("This is your last chance.\n");
|
||||
}
|
||||
print_s0(-1);
|
||||
if (!t_flag) {
|
||||
if (ok("Should we write new partition table?"))
|
||||
write_s0();
|
||||
} else {
|
||||
printf("\n-t flag specified -- partition table not written.\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
exit(0);
|
||||
}
|
||||
|
||||
static void
|
||||
usage()
|
||||
{
|
||||
fprintf(stderr, "%s%s",
|
||||
"usage: fdisk [-BIaistu] [-12345678] [disk]\n",
|
||||
" fdisk -f configfile [-itv] [disk]\n");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
static struct pc98_partition mtpart;
|
||||
|
||||
static int
|
||||
part_unused(int i)
|
||||
{
|
||||
struct pc98_partition *partp;
|
||||
|
||||
partp = ((struct pc98_partition *) &mboot.parts) + i - 1;
|
||||
return (bcmp(partp, &mtpart, sizeof (struct pc98_partition)) == 0);
|
||||
}
|
||||
|
||||
static void
|
||||
print_s0(int which)
|
||||
{
|
||||
int i;
|
||||
|
||||
print_params();
|
||||
printf("Information from DOS bootblock is:\n");
|
||||
if (which == -1) {
|
||||
for (i = 1; i <= PC98_NPARTS; i++)
|
||||
if (v_flag || !part_unused(i)) {
|
||||
printf("%d: ", i);
|
||||
print_part(i);
|
||||
}
|
||||
}
|
||||
else
|
||||
print_part(which);
|
||||
}
|
||||
|
||||
static void
|
||||
print_part(int i)
|
||||
{
|
||||
struct pc98_partition *partp;
|
||||
u_int64_t part_sz, part_mb;
|
||||
|
||||
if (part_unused(i)) {
|
||||
printf("<UNUSED>\n");
|
||||
return;
|
||||
}
|
||||
/*
|
||||
* Be careful not to overflow.
|
||||
*/
|
||||
partp = ((struct pc98_partition *) &mboot.parts) + i - 1;
|
||||
part_sz = (partp->dp_ecyl - partp->dp_scyl + 1) * cylsecs;
|
||||
part_mb = part_sz * secsize;
|
||||
part_mb /= (1024 * 1024);
|
||||
printf("sysmid %d (%#04x),(%s)\n", partp->dp_mid, partp->dp_mid,
|
||||
get_type(partp->dp_mid));
|
||||
printf(" start %lu, size %lu (%ju Meg), sid %d\n",
|
||||
(u_long)(partp->dp_scyl * cylsecs), (u_long)part_sz,
|
||||
(uintmax_t)part_mb, partp->dp_sid);
|
||||
printf("\tbeg: cyl %d/ head %d/ sector %d;\n\tend: cyl %d/ head %d/ sector %d\n"
|
||||
,partp->dp_scyl
|
||||
,partp->dp_shd
|
||||
,partp->dp_ssect
|
||||
,partp->dp_ecyl
|
||||
,partp->dp_ehd
|
||||
,partp->dp_esect);
|
||||
printf ("\tsystem Name %.16s\n", partp->dp_name);
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
init_boot(void)
|
||||
{
|
||||
|
||||
mboot.signature = PC98_MAGIC;
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
init_sector0(unsigned long start)
|
||||
{
|
||||
struct pc98_partition *partp =
|
||||
(struct pc98_partition *)(&mboot.parts[0]);
|
||||
|
||||
init_boot();
|
||||
|
||||
partp->dp_mid = DOSMID_386BSD;
|
||||
partp->dp_sid = DOSSID_386BSD;
|
||||
|
||||
dos(start, disksecs - start, partp);
|
||||
}
|
||||
|
||||
static void
|
||||
change_part(int i, int force)
|
||||
{
|
||||
struct pc98_partition *partp =
|
||||
((struct pc98_partition *) &mboot.parts) + i - 1;
|
||||
|
||||
if (!force && part_unused(i))
|
||||
return;
|
||||
|
||||
printf("The data for partition %d is:\n", i);
|
||||
print_part(i);
|
||||
|
||||
if (u_flag && ok("Do you want to change it?")) {
|
||||
int tmp;
|
||||
|
||||
if (i_flag) {
|
||||
bzero((char *)partp, sizeof (struct pc98_partition));
|
||||
if (i == 1) {
|
||||
init_sector0(1);
|
||||
printf("\nThe static data for the slice 1 has been reinitialized to:\n");
|
||||
print_part(i);
|
||||
}
|
||||
}
|
||||
do {
|
||||
int x_start = partp->dp_scyl * cylsecs ;
|
||||
int x_size = (partp->dp_ecyl - partp->dp_scyl + 1) * cylsecs;
|
||||
Decimal("sysmid", partp->dp_mid, tmp);
|
||||
Decimal("syssid", partp->dp_sid, tmp);
|
||||
String ("system name", partp->dp_name, 16);
|
||||
Decimal("start", x_start, tmp);
|
||||
Decimal("size", x_size, tmp);
|
||||
|
||||
if (ok("Explicitly specify beg/end address ?"))
|
||||
{
|
||||
int tsec,tcyl,thd;
|
||||
tcyl = partp->dp_scyl;
|
||||
thd = partp->dp_shd;
|
||||
tsec = partp->dp_ssect;
|
||||
Decimal("beginning cylinder", tcyl, tmp);
|
||||
Decimal("beginning head", thd, tmp);
|
||||
Decimal("beginning sector", tsec, tmp);
|
||||
partp->dp_scyl = tcyl;
|
||||
partp->dp_ssect = tsec;
|
||||
partp->dp_shd = thd;
|
||||
partp->dp_ipl_cyl = partp->dp_scyl;
|
||||
partp->dp_ipl_sct = partp->dp_ssect;
|
||||
partp->dp_ipl_head = partp->dp_shd;
|
||||
|
||||
tcyl = partp->dp_ecyl;
|
||||
thd = partp->dp_ehd;
|
||||
tsec = partp->dp_esect;
|
||||
Decimal("ending cylinder", tcyl, tmp);
|
||||
Decimal("ending head", thd, tmp);
|
||||
Decimal("ending sector", tsec, tmp);
|
||||
partp->dp_ecyl = tcyl;
|
||||
partp->dp_esect = tsec;
|
||||
partp->dp_ehd = thd;
|
||||
} else
|
||||
dos(x_start, x_size, partp);
|
||||
|
||||
print_part(i);
|
||||
} while (!ok("Are we happy with this entry?"));
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
print_params()
|
||||
{
|
||||
printf("parameters extracted from in-core disklabel are:\n");
|
||||
printf("cylinders=%d heads=%d sectors/track=%d (%d blks/cyl)\n\n"
|
||||
,cyls,heads,sectors,cylsecs);
|
||||
if (dos_cyls > 65535 || dos_heads > 255 || dos_sectors > 255)
|
||||
printf("Figures below won't work with BIOS for partitions not in cyl 1\n");
|
||||
printf("parameters to be used for BIOS calculations are:\n");
|
||||
printf("cylinders=%d heads=%d sectors/track=%d (%d blks/cyl)\n\n"
|
||||
,dos_cyls,dos_heads,dos_sectors,dos_cylsecs);
|
||||
}
|
||||
|
||||
static void
|
||||
change_active(int which)
|
||||
{
|
||||
struct pc98_partition *partp = &mboot.parts[0];
|
||||
int active, i, new, tmp;
|
||||
|
||||
active = -1;
|
||||
for (i = 0; i < PC98_NPARTS; i++) {
|
||||
if ((partp[i].dp_sid & PC98_SID_ACTIVE) == 0)
|
||||
continue;
|
||||
printf("Partition %d is marked active\n", i + 1);
|
||||
if (active == -1)
|
||||
active = i + 1;
|
||||
}
|
||||
if (a_flag && which != -1)
|
||||
active = which;
|
||||
else if (active == -1)
|
||||
active = 1;
|
||||
|
||||
if (!ok("Do you want to change the active partition?"))
|
||||
return;
|
||||
setactive:
|
||||
do {
|
||||
new = active;
|
||||
Decimal("active partition", new, tmp);
|
||||
if (new < 1 || new > 8) {
|
||||
printf("Active partition number must be in range 1-8."
|
||||
" Try again.\n");
|
||||
goto setactive;
|
||||
}
|
||||
active = new;
|
||||
} while (!ok("Are you happy with this choice"));
|
||||
if (active > 0 && active <= 8)
|
||||
partp[active-1].dp_sid |= PC98_SID_ACTIVE;
|
||||
}
|
||||
|
||||
static void
|
||||
change_code()
|
||||
{
|
||||
if (ok("Do you want to change the boot code?"))
|
||||
init_boot();
|
||||
}
|
||||
|
||||
void
|
||||
get_params_to_use()
|
||||
{
|
||||
int tmp;
|
||||
print_params();
|
||||
if (ok("Do you want to change our idea of what BIOS thinks ?"))
|
||||
{
|
||||
do
|
||||
{
|
||||
Decimal("BIOS's idea of #cylinders", dos_cyls, tmp);
|
||||
Decimal("BIOS's idea of #heads", dos_heads, tmp);
|
||||
Decimal("BIOS's idea of #sectors", dos_sectors, tmp);
|
||||
dos_cylsecs = dos_heads * dos_sectors;
|
||||
print_params();
|
||||
}
|
||||
while(!ok("Are you happy with this choice"));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/***********************************************\
|
||||
* Change real numbers into strange dos numbers *
|
||||
\***********************************************/
|
||||
static void
|
||||
dos(u_int32_t start, u_int32_t size, struct pc98_partition *partp)
|
||||
{
|
||||
u_int32_t end;
|
||||
|
||||
if (partp->dp_mid == 0 && partp->dp_sid == 0 &&
|
||||
start == 0 && size == 0) {
|
||||
memcpy(partp, &mtpart, sizeof(*partp));
|
||||
return;
|
||||
}
|
||||
|
||||
/* Start c/h/s. */
|
||||
partp->dp_scyl = partp->dp_ipl_cyl = start / dos_cylsecs;
|
||||
partp->dp_shd = partp->dp_ipl_head = start % dos_cylsecs / dos_sectors;
|
||||
partp->dp_ssect = partp->dp_ipl_sct = start % dos_sectors;
|
||||
|
||||
/* End c/h/s. */
|
||||
end = start + size - cylsecs;
|
||||
partp->dp_ecyl = end / dos_cylsecs;
|
||||
partp->dp_ehd = end % dos_cylsecs / dos_sectors;
|
||||
partp->dp_esect = end % dos_sectors;
|
||||
}
|
||||
|
||||
static int
|
||||
open_disk(int flag)
|
||||
{
|
||||
struct stat st;
|
||||
int rwmode;
|
||||
|
||||
if (stat(disk, &st) == -1) {
|
||||
if (errno == ENOENT)
|
||||
return -2;
|
||||
warnx("can't get file status of %s", disk);
|
||||
return -1;
|
||||
}
|
||||
if ( !(st.st_mode & S_IFCHR) )
|
||||
warnx("device %s is not character special", disk);
|
||||
rwmode = I_flag || a_flag || B_flag || flag ? O_RDWR : O_RDONLY;
|
||||
fd = open(disk, rwmode);
|
||||
if (fd == -1 && errno == EPERM && rwmode == O_RDWR)
|
||||
fd = open(disk, O_RDONLY);
|
||||
if (fd == -1 && errno == ENXIO)
|
||||
return -2;
|
||||
if (fd == -1) {
|
||||
warnx("can't open device %s", disk);
|
||||
return -1;
|
||||
}
|
||||
if (get_params() == -1) {
|
||||
warnx("can't get disk parameters on %s", disk);
|
||||
return -1;
|
||||
}
|
||||
return fd;
|
||||
}
|
||||
|
||||
static ssize_t
|
||||
read_disk(off_t sector, void *buf)
|
||||
{
|
||||
|
||||
lseek(fd, (sector * 512), 0);
|
||||
return read(fd, buf,
|
||||
secsize > MIN_SEC_SIZE ? secsize : MIN_SEC_SIZE * 2);
|
||||
}
|
||||
|
||||
static int
|
||||
write_disk(off_t sector, void *buf)
|
||||
{
|
||||
int error;
|
||||
struct gctl_req *grq;
|
||||
const char *q;
|
||||
char fbuf[BUFSIZ];
|
||||
int i, fdw, sz;
|
||||
|
||||
sz = secsize > MIN_SEC_SIZE ? secsize : MIN_SEC_SIZE * 2;
|
||||
grq = gctl_get_handle();
|
||||
gctl_ro_param(grq, "verb", -1, "write PC98");
|
||||
gctl_ro_param(grq, "class", -1, "PC98");
|
||||
q = strrchr(disk, '/');
|
||||
if (q == NULL)
|
||||
q = disk;
|
||||
else
|
||||
q++;
|
||||
gctl_ro_param(grq, "geom", -1, q);
|
||||
gctl_ro_param(grq, "data", sz, buf);
|
||||
q = gctl_issue(grq);
|
||||
if (q == NULL) {
|
||||
gctl_free(grq);
|
||||
return(0);
|
||||
}
|
||||
warnx("Geom problem: %s", q);
|
||||
gctl_free(grq);
|
||||
|
||||
warnx("Warning: Partitioning via geom failed, trying raw write");
|
||||
error = pwrite(fd, buf, sz, sector * 512);
|
||||
if (error == sz)
|
||||
return (0);
|
||||
|
||||
for (i = 0; i < PC98_NPARTS; i++) {
|
||||
sprintf(fbuf, "%ss%d", disk, i + 1);
|
||||
fdw = open(fbuf, O_RDWR, 0);
|
||||
if (fdw < 0)
|
||||
continue;
|
||||
error = ioctl(fdw, DIOCSPC98, buf);
|
||||
close(fdw);
|
||||
if (error == 0)
|
||||
return (0);
|
||||
}
|
||||
warnx("Failed to write sector zero");
|
||||
return(EINVAL);
|
||||
}
|
||||
|
||||
static int
|
||||
get_params()
|
||||
{
|
||||
int error;
|
||||
u_int u;
|
||||
off_t o;
|
||||
|
||||
error = ioctl(fd, DIOCGFWSECTORS, &u);
|
||||
if (error == 0)
|
||||
sectors = dos_sectors = u;
|
||||
else
|
||||
sectors = dos_sectors = 17;
|
||||
|
||||
error = ioctl(fd, DIOCGFWHEADS, &u);
|
||||
if (error == 0)
|
||||
heads = dos_heads = u;
|
||||
else
|
||||
heads = dos_heads = 8;
|
||||
|
||||
dos_cylsecs = cylsecs = heads * sectors;
|
||||
disksecs = cyls * heads * sectors;
|
||||
|
||||
error = ioctl(fd, DIOCGSECTORSIZE, &u);
|
||||
if (error != 0 || u == 0)
|
||||
u = 512;
|
||||
secsize = u;
|
||||
|
||||
error = ioctl(fd, DIOCGMEDIASIZE, &o);
|
||||
if (error == 0) {
|
||||
disksecs = o / u;
|
||||
cyls = dos_cyls = o / (u * dos_heads * dos_sectors);
|
||||
}
|
||||
|
||||
return (disksecs);
|
||||
}
|
||||
|
||||
|
||||
static int
|
||||
read_s0()
|
||||
{
|
||||
|
||||
if (read_disk(0, (char *) mboot.bootinst) == -1) {
|
||||
warnx("can't read fdisk partition table");
|
||||
return -1;
|
||||
}
|
||||
if (mboot.signature != PC98_MAGIC) {
|
||||
warnx("invalid fdisk partition table found");
|
||||
/* So should we initialize things */
|
||||
return -1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
write_s0()
|
||||
{
|
||||
|
||||
if (iotest) {
|
||||
print_s0(-1);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* write enable label sector before write (if necessary),
|
||||
* disable after writing.
|
||||
* needed if the disklabel protected area also protects
|
||||
* sector 0. (e.g. empty disk)
|
||||
*/
|
||||
if (write_disk(0, (char *) mboot.bootinst) == -1) {
|
||||
warn("can't write fdisk partition table");
|
||||
return -1;
|
||||
}
|
||||
|
||||
return(0);
|
||||
}
|
||||
|
||||
|
||||
static int
|
||||
ok(const char *str)
|
||||
{
|
||||
printf("%s [n] ", str);
|
||||
fflush(stdout);
|
||||
if (fgets(lbuf, LBUF, stdin) == NULL)
|
||||
exit(1);
|
||||
lbuf[strlen(lbuf)-1] = 0;
|
||||
|
||||
if (*lbuf &&
|
||||
(!strcmp(lbuf, "yes") || !strcmp(lbuf, "YES") ||
|
||||
!strcmp(lbuf, "y") || !strcmp(lbuf, "Y")))
|
||||
return 1;
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
decimal(const char *str, int *num, int deflt)
|
||||
{
|
||||
int acc = 0, c;
|
||||
char *cp;
|
||||
|
||||
while (1) {
|
||||
printf("Supply a decimal value for \"%s\" [%d] ", str, deflt);
|
||||
fflush(stdout);
|
||||
if (fgets(lbuf, LBUF, stdin) == NULL)
|
||||
exit(1);
|
||||
lbuf[strlen(lbuf)-1] = 0;
|
||||
|
||||
if (!*lbuf)
|
||||
return 0;
|
||||
|
||||
cp = lbuf;
|
||||
while ((c = *cp) && (c == ' ' || c == '\t')) cp++;
|
||||
if (!c)
|
||||
return 0;
|
||||
while ((c = *cp++)) {
|
||||
if (c <= '9' && c >= '0')
|
||||
acc = acc * 10 + c - '0';
|
||||
else
|
||||
break;
|
||||
}
|
||||
if (c == ' ' || c == '\t')
|
||||
while ((c = *cp) && (c == ' ' || c == '\t')) cp++;
|
||||
if (!c) {
|
||||
*num = acc;
|
||||
return 1;
|
||||
} else
|
||||
printf("%s is an invalid decimal number. Try again.\n",
|
||||
lbuf);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
static int
|
||||
string(const char *str, char **ans)
|
||||
{
|
||||
int i, c;
|
||||
char *cp = lbuf;
|
||||
|
||||
while (1) {
|
||||
printf("Supply a string value for \"%s\" [%s] ", str, *ans);
|
||||
fgets(lbuf, LBUF, stdin);
|
||||
lbuf[strlen(lbuf)-1] = 0;
|
||||
|
||||
if (!*lbuf)
|
||||
return 0;
|
||||
|
||||
while ((c = *cp) && (c == ' ' || c == '\t')) cp++;
|
||||
if (c == '"') {
|
||||
c = *++cp;
|
||||
*ans = cp;
|
||||
while ((c = *cp) && c != '"') cp++;
|
||||
} else {
|
||||
*ans = cp;
|
||||
while ((c = *cp) && c != ' ' && c != '\t') cp++;
|
||||
}
|
||||
|
||||
for (i = strlen(*ans); i < 16; i++)
|
||||
(*ans)[i] = ' ';
|
||||
(*ans)[16] = 0;
|
||||
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
static const char *
|
||||
get_type(int type)
|
||||
{
|
||||
size_t i;
|
||||
|
||||
for (i = 0; i < nitems(part_types); i++)
|
||||
if (part_types[i].type == (type & 0x7f))
|
||||
return(part_types[i].name);
|
||||
return("unknown");
|
||||
}
|
||||
|
||||
/*
|
||||
* Try figuring out the root device's canonical disk name.
|
||||
* The following choices are considered:
|
||||
* /dev/ad0s1a => /dev/ad0
|
||||
* /dev/da0a => /dev/da0
|
||||
* /dev/vinum/root => /dev/vinum/root
|
||||
*/
|
||||
static char *
|
||||
get_rootdisk(void)
|
||||
{
|
||||
struct statfs rootfs;
|
||||
regex_t re;
|
||||
#define NMATCHES 2
|
||||
regmatch_t rm[NMATCHES];
|
||||
char *s;
|
||||
int rv;
|
||||
|
||||
if (statfs("/", &rootfs) == -1)
|
||||
err(1, "statfs(\"/\")");
|
||||
|
||||
if ((rv = regcomp(&re, "^(/dev/[a-z]+[0-9]+)([sp][0-9]+)?[a-h]?$",
|
||||
REG_EXTENDED)) != 0)
|
||||
errx(1, "regcomp() failed (%d)", rv);
|
||||
if ((rv = regexec(&re, rootfs.f_mntfromname, NMATCHES, rm, 0)) != 0)
|
||||
errx(1,
|
||||
"mounted root fs resource doesn't match expectations (regexec returned %d)",
|
||||
rv);
|
||||
if ((s = malloc(rm[1].rm_eo - rm[1].rm_so + 1)) == NULL)
|
||||
errx(1, "out of memory");
|
||||
memcpy(s, rootfs.f_mntfromname + rm[1].rm_so,
|
||||
rm[1].rm_eo - rm[1].rm_so);
|
||||
s[rm[1].rm_eo - rm[1].rm_so] = 0;
|
||||
|
||||
return s;
|
||||
}
|
||||
|
||||
static void
|
||||
reset_boot(void)
|
||||
{
|
||||
int i;
|
||||
struct pc98_partition *partp;
|
||||
|
||||
init_boot();
|
||||
for (i = 1; i <= PC98_NPARTS; i++) {
|
||||
partp = ((struct pc98_partition *) &mboot.parts) + i - 1;
|
||||
bzero((char *)partp, sizeof (struct pc98_partition));
|
||||
}
|
||||
}
|
@ -543,11 +543,6 @@ The
|
||||
option enables backward compatibility for partition names
|
||||
in the EBR scheme.
|
||||
It also prevents any type of actions on such partitions.
|
||||
.It Cm PC98
|
||||
An MBR variant for NEC PC-98 and compatible computers.
|
||||
Requires the
|
||||
.Cm GEOM_PART_PC98
|
||||
kernel option.
|
||||
.It Cm VTOC8
|
||||
Sun's SMI Volume Table Of Contents, used by
|
||||
.Tn SPARC64
|
||||
@ -945,12 +940,6 @@ The scheme-specific attributes for MBR:
|
||||
.Bl -tag -width ".Cm active"
|
||||
.It Cm active
|
||||
.El
|
||||
.Pp
|
||||
The scheme-specific attributes for PC98:
|
||||
.Bl -tag -width ".Cm bootable"
|
||||
.It Cm active
|
||||
.It Cm bootable
|
||||
.El
|
||||
.Sh BOOTSTRAPPING
|
||||
.Fx
|
||||
supports several partitioning schemes and each scheme uses different
|
||||
|
@ -12,49 +12,26 @@ variable rt_el
|
||||
variable rb_el
|
||||
variable fill
|
||||
|
||||
s" arch-pc98" environment? [if]
|
||||
\ Single frames
|
||||
149 constant sh_el
|
||||
150 constant sv_el
|
||||
152 constant slt_el
|
||||
154 constant slb_el
|
||||
153 constant srt_el
|
||||
155 constant srb_el
|
||||
\ Double frames
|
||||
149 constant dh_el
|
||||
150 constant dv_el
|
||||
152 constant dlt_el
|
||||
154 constant dlb_el
|
||||
153 constant drt_el
|
||||
155 constant drb_el
|
||||
\ Fillings
|
||||
0 constant fill_none
|
||||
32 constant fill_blank
|
||||
135 constant fill_dark
|
||||
135 constant fill_med
|
||||
135 constant fill_bright
|
||||
[else]
|
||||
\ Single frames
|
||||
196 constant sh_el
|
||||
179 constant sv_el
|
||||
218 constant slt_el
|
||||
192 constant slb_el
|
||||
191 constant srt_el
|
||||
217 constant srb_el
|
||||
\ Double frames
|
||||
205 constant dh_el
|
||||
186 constant dv_el
|
||||
201 constant dlt_el
|
||||
200 constant dlb_el
|
||||
187 constant drt_el
|
||||
188 constant drb_el
|
||||
\ Fillings
|
||||
0 constant fill_none
|
||||
32 constant fill_blank
|
||||
176 constant fill_dark
|
||||
177 constant fill_med
|
||||
178 constant fill_bright
|
||||
[then]
|
||||
\ Single frames
|
||||
196 constant sh_el
|
||||
179 constant sv_el
|
||||
218 constant slt_el
|
||||
192 constant slb_el
|
||||
191 constant srt_el
|
||||
217 constant srb_el
|
||||
\ Double frames
|
||||
205 constant dh_el
|
||||
186 constant dv_el
|
||||
201 constant dlt_el
|
||||
200 constant dlb_el
|
||||
187 constant drt_el
|
||||
188 constant drb_el
|
||||
\ Fillings
|
||||
0 constant fill_none
|
||||
32 constant fill_blank
|
||||
176 constant fill_dark
|
||||
177 constant fill_med
|
||||
178 constant fill_bright
|
||||
|
||||
: hline ( len x y -- ) \ Draw horizontal single line
|
||||
at-xy \ move cursor
|
||||
|
@ -204,12 +204,6 @@ AdvanSys ABP950
|
||||
AdvanSys ABP980, ABP980U
|
||||
.It
|
||||
AdvanSys ABP980UA/3980UA
|
||||
.It
|
||||
MELCO IFC-USP (PC-98)
|
||||
.It
|
||||
RATOC REX-PCI30 (PC-98)
|
||||
.It
|
||||
@Nifty FNECHARD IFC-USUP-TX (PC-98)
|
||||
.El
|
||||
.Sh SEE ALSO
|
||||
.Xr adw 4 ,
|
||||
|
@ -349,14 +349,6 @@ Adaptec
|
||||
Adaptec
|
||||
.Tn 4944UW
|
||||
.It
|
||||
NEC PC-9821Xt13 (PC-98)
|
||||
.It
|
||||
NEC RvII26 (PC-98)
|
||||
.It
|
||||
NEC PC-9821X-B02L/B09 (PC-98)
|
||||
.It
|
||||
NEC SV-98/2-B03 (PC-98)
|
||||
.It
|
||||
Many motherboards with on-board
|
||||
.Tn SCSI
|
||||
support
|
||||
|
@ -32,7 +32,7 @@
|
||||
.Nd Advanced Programmable Interrupt Controller (APIC) driver
|
||||
.Sh SYNOPSIS
|
||||
This driver is a mandatory part of amd64 kernel.
|
||||
To compile this driver into i386 or pc98 kernel,
|
||||
To compile this driver into i386 kernel,
|
||||
place the following line in your
|
||||
kernel configuration file:
|
||||
.Bd -ragged -offset indent
|
||||
|
@ -133,12 +133,6 @@ Accton EN2212/EN2216/UE2216
|
||||
.It
|
||||
Allied Telesis CentreCOM LA100-PCM_V2
|
||||
.It
|
||||
Allied Telesis LA-98 (flags 0x000000) (PC-98)
|
||||
.It
|
||||
Allied Telesis SIC-98, SIC-98NOTE (110pin), SIU-98 (flags 0x600000) (PC-98)
|
||||
.It
|
||||
Allied Telesis SIU-98-D (flags 0x610000) (PC-98)
|
||||
.It
|
||||
AmbiCom 10BaseT card (8002, 8002T, 8010 and 8610)
|
||||
.It
|
||||
Bay Networks NETGEAR FA410TXC Fast Ethernet
|
||||
@ -163,12 +157,6 @@ Compex Net-A adapter
|
||||
.It
|
||||
Compex RL2000
|
||||
.It
|
||||
Contec C-NET(98), RT-1007(98), C-NET(9N) (110pin) (flags 0xa00000) (PC-98)
|
||||
.It
|
||||
Contec C-NET(98)E-A, C-NET(98)L-A, C-NET(98)P (flags 0x300000) (PC-98)
|
||||
.It
|
||||
Corega Ether98-T (flags 0x000000) (PC-98)
|
||||
.It
|
||||
Corega Ether PCC-T/EtherII PCC-T/FEther PCC-TXF/PCC-TXD PCC-T/Fether II TXD
|
||||
.It
|
||||
Corega LAPCCTXD (TC5299J)
|
||||
@ -179,16 +167,10 @@ DEC EtherWorks DE305
|
||||
.It
|
||||
Danpex EN-6200P2
|
||||
.It
|
||||
D-Link DE-298, DE-298P (flags 0x500000) (PC-98)
|
||||
.It
|
||||
D-Link DE-660, DE-660+
|
||||
.It
|
||||
D-Link IC-CARD/IC-CARD+ Ethernet
|
||||
.It
|
||||
ELECOM LD-98P (flags 0x500000) (PC-98)
|
||||
.It
|
||||
ELECOM LD-BDN, LD-NW801G (flags 0x200000) (PC-98)
|
||||
.It
|
||||
ELECOM Laneed LD-CDL/TX, LD-CDF, LD-CDS, LD-10/100CD, LD-CDWA (DP83902A)
|
||||
.It
|
||||
Hawking PN652TX PC Card (AX88790)
|
||||
@ -198,17 +180,10 @@ HP PC Lan+ 27247B and 27252A
|
||||
.It
|
||||
IBM Creditcard Ethernet I/II
|
||||
.It
|
||||
ICM AD-ET2-T, DT-ET-25, DT-ET-T5, IF-2766ET, IF-2771ET, NB-ET-T (110pin)
|
||||
(flags 0x500000) (PC-98)
|
||||
.It
|
||||
I-O DATA LA/T-98, LA/T-98SB, LA2/T-98, ET/T-98 (flags 0x900000) (PC-98)
|
||||
.It
|
||||
I-O DATA ET2/T-PCI
|
||||
.It
|
||||
I-O DATA PCLATE
|
||||
.It
|
||||
Kansai KLA-98C/T (flags 0x900000) (PC-98)
|
||||
.It
|
||||
Kingston KNE-PC2, CIO10T, KNE-PCM/x Ethernet
|
||||
.It
|
||||
KTI ET32P2 PCI
|
||||
@ -217,28 +192,14 @@ Linksys EC2T/PCMPC100/PCM100, PCMLM56
|
||||
.It
|
||||
Linksys EtherFast 10/100 PC Card, Combo PCMCIA Ethernet Card (PCMPC100 V2)
|
||||
.It
|
||||
Logitec LAN-98T (flags 0xb00000) (PC-98)
|
||||
.It
|
||||
MACNICA Ethernet ME1 for JEIDA
|
||||
.It
|
||||
MACNICA ME98 (flags 0x900000) (PC-98)
|
||||
.It
|
||||
MACNICA NE2098 (flags 0x400000) (PC-98)
|
||||
.It
|
||||
MELCO EGY-98 (flags 0x300000) (PC-98)
|
||||
.It
|
||||
MELCO LGH-98, LGY-98, LGY-98-N (110pin), IND-SP, IND-SS (flags 0x400000) (PC-98)
|
||||
.It
|
||||
MELCO LGY-PCI-TR
|
||||
.It
|
||||
MELCO LPC-T/LPC2-T/LPC2-CLT/LPC2-TX/LPC3-TX/LPC3-CLX
|
||||
.It
|
||||
NDC Ethernet Instant-Link
|
||||
.It
|
||||
NEC PC-9801-77, PC-9801-78 (flags 0x910000) (PC-98)
|
||||
.It
|
||||
NEC PC-9801-107, PC-9801-108 (flags 0x800000) (PC-98)
|
||||
.It
|
||||
National Semiconductor InfoMover NE4100
|
||||
.It
|
||||
NetGear FA-410TX
|
||||
@ -247,10 +208,6 @@ NetVin NV5000SC
|
||||
.It
|
||||
Network Everywhere Ethernet 10BaseT PC Card
|
||||
.It
|
||||
Networld 98X3 (flags 0xd00000) (PC-98)
|
||||
.It
|
||||
Networld EC-98X, EP-98X (flags 0xd10000) (PC-98)
|
||||
.It
|
||||
New Media LANSurfer 10+56 Ethernet/Modem
|
||||
.It
|
||||
New Media LANSurfer
|
||||
@ -259,10 +216,6 @@ Novell NE1000/NE2000/NE2100
|
||||
.It
|
||||
PLANEX ENW-8300-T
|
||||
.It
|
||||
PLANEX EN-2298-C (flags 0x200000) (PC-98)
|
||||
.It
|
||||
PLANEX EN-2298P-T, EN-2298-T (flags 0x500000) (PC-98)
|
||||
.It
|
||||
PLANEX FNW-3600-T
|
||||
.It
|
||||
Psion 10/100 LANGLOBAL Combine iT
|
||||
@ -277,8 +230,6 @@ SMC Elite 16 WD8013
|
||||
.It
|
||||
SMC Elite Ultra
|
||||
.It
|
||||
SMC EtherEZ98 (flags 0x000000) (PC-98)
|
||||
.It
|
||||
SMC WD8003E/WD8003EBT/WD8003S/WD8003SBT/WD8003W/WD8013EBT/WD8013W and clones
|
||||
.It
|
||||
SMC EZCard PC Card, 8040-TX, 8041-TX (AX88x90), 8041-TX V.2 (TC5299J)
|
||||
@ -306,7 +257,7 @@ Winbond W89C940
|
||||
Winbond W89C940F
|
||||
.El
|
||||
.Pp
|
||||
C-Bus, ISA, PCI and PC Card devices are supported.
|
||||
ISA, PCI and PC Card devices are supported.
|
||||
.Pp
|
||||
The
|
||||
.Nm
|
||||
|
@ -66,8 +66,6 @@ driver include:
|
||||
.Pp
|
||||
.Bl -bullet -compact
|
||||
.It
|
||||
MELCO IFC-DP (PC-98)
|
||||
.It
|
||||
Sun ESP family
|
||||
.It
|
||||
Sun FAS family
|
||||
|
@ -137,12 +137,6 @@ Intel PRO/100 M Desktop Adapter
|
||||
.It
|
||||
Intel PRO/100 S Desktop, Server and Dual-Port Server Adapters
|
||||
.It
|
||||
Contec C-NET(PI)-100TX (PC-98)
|
||||
.It
|
||||
NEC PC-9821Ra20, Rv20, Xv13, Xv20 internal 100Base-TX (PC-98)
|
||||
.It
|
||||
NEC PC-9821X-B06 (PC-98)
|
||||
.It
|
||||
Many on-board network interfaces on Intel motherboards
|
||||
.El
|
||||
.Sh LOADER TUNABLES
|
||||
|
@ -65,9 +65,7 @@
|
||||
.Cd options GEOM_PART_GPT
|
||||
.Cd options GEOM_PART_LDM
|
||||
.Cd options GEOM_PART_MBR
|
||||
.Cd options GEOM_PART_PC98
|
||||
.Cd options GEOM_PART_VTOC8
|
||||
.Cd options GEOM_PC98
|
||||
.Cd options GEOM_RAID
|
||||
.Cd options GEOM_RAID3
|
||||
.Cd options GEOM_SHSEC
|
||||
|
@ -57,13 +57,6 @@ module at boot time, place the following line in
|
||||
if_le_load="YES"
|
||||
.Ed
|
||||
.Pp
|
||||
For C-Bus non-PnP adapters, the port address and the IRQ number have to be
|
||||
specified in
|
||||
.Pa /boot/device.hints :
|
||||
.Cd hint.le.0.at="isa"
|
||||
.Cd hint.le.0.port="0x03d0"
|
||||
.Cd hint.le.0.irq="6"
|
||||
.Pp
|
||||
For ISA non-PnP adapters, the port address as well as the IRQ and the DRQ
|
||||
numbers have to be specified in
|
||||
.Pa /boot/device.hints :
|
||||
|
@ -8,7 +8,6 @@ MAN= aic.4 \
|
||||
cp.4 \
|
||||
CPU_ELAN.4 \
|
||||
cs.4 \
|
||||
ct.4 \
|
||||
ctau.4 \
|
||||
cx.4 \
|
||||
ep.4 \
|
||||
@ -26,7 +25,6 @@ MAN= aic.4 \
|
||||
pnpbios.4 \
|
||||
sbni.4 \
|
||||
smapi.4 \
|
||||
snc.4 \
|
||||
streams.4 \
|
||||
svr4.4 \
|
||||
vpd.4 \
|
||||
|
@ -62,10 +62,6 @@ Adaptec AHA-1535 (ISA)
|
||||
Creative Labs SoundBlaster SCSI host adapter (ISA)
|
||||
.It
|
||||
Adaptec AHA-1460, AHA-1460B, AHA-1460C, AHA-1460D (PC Card)
|
||||
.It
|
||||
Adaptec AHA-1030B, AHA-1030P (PC98)
|
||||
.It
|
||||
NEC PC-9801-100 (PC98)
|
||||
.El
|
||||
.Sh SEE ALSO
|
||||
.Xr aha 4 ,
|
||||
|
@ -1,162 +0,0 @@
|
||||
.\" Copyright (c) 2003 Noriaki MITSUNAGA. All rights reserved.
|
||||
.\" Copyright (c) 2003 Hideyuki KURASHINA. All rights reserved.
|
||||
.\"
|
||||
.\" Redistribution and use in source and binary forms, with or without
|
||||
.\" modification, are permitted provided that the following conditions
|
||||
.\" are met:
|
||||
.\" 1. Redistributions of source code must retain the above copyright
|
||||
.\" notice, this list of conditions and the following disclaimer.
|
||||
.\" 2. Redistributions in binary form must reproduce the above copyright
|
||||
.\" notice, this list of conditions and the following disclaimer in the
|
||||
.\" documentation and/or other materials provided with the distribution.
|
||||
.\"
|
||||
.\" THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND
|
||||
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
.\" ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE
|
||||
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
.\" SUCH DAMAGE.
|
||||
.\"
|
||||
.\" $FreeBSD$
|
||||
.\"
|
||||
.Dd November 18, 2003
|
||||
.Dt CT 4 i386
|
||||
.Os
|
||||
.Sh NAME
|
||||
.Nm ct
|
||||
.Nd "WD33C93[ABC] based CBUS SCSI host adapter driver"
|
||||
.Sh SYNOPSIS
|
||||
.Cd "device ct"
|
||||
.Cd "device scbus"
|
||||
.Pp
|
||||
In
|
||||
.Pa /boot/device.hints:
|
||||
.Pp
|
||||
For most PC-9801-55, -92 and compatibles:
|
||||
.Cd hint.ct.0.at="isa"
|
||||
.Pp
|
||||
For ELECOM bus-master
|
||||
.Tn SCSI
|
||||
adapters:
|
||||
.Cd hint.ct.0.at="isa"
|
||||
.Cd hint.ct.0.flags="0x30000"
|
||||
.Pp
|
||||
For I-O DATA SC98 adapters:
|
||||
.Cd hint.ct.0.at="isa"
|
||||
.Cd hint.ct.0.flags="0x10000"
|
||||
.Pp
|
||||
For LOGITEC adapters:
|
||||
.Cd hint.ct.0.at="isa"
|
||||
.Cd hint.ct.0.flags="0x50000"
|
||||
.Pp
|
||||
For TEXA adapters:
|
||||
.Cd hint.ct.0.at="isa"
|
||||
.Cd hint.ct.0.flags="0x20000"
|
||||
.Pp
|
||||
For adapters with SMIT transfer mode to enable SMIT transfer:
|
||||
.Cd hint.ct.0.at="isa"
|
||||
.Cd hint.ct.0.flags="0x40000"
|
||||
.Cd hint.ct.0.maddr="0xdc000"
|
||||
.Pp
|
||||
Flags meaning:
|
||||
.Bl -tag -offset indent -compact -width 0x000000
|
||||
.It 0x00000
|
||||
DMA transfer mode for an NEC PC-9801-55, -92 (or
|
||||
compatibles), ICM IF-2660, Midori-Denshi MDC-554NA, or
|
||||
Logitec LHA-N151
|
||||
.It 0x10000
|
||||
DMA transfer mode for an I-O DATA SC-98II
|
||||
.It 0x20000
|
||||
bus-master transfer mode for a TEXA HA-55BS2, its
|
||||
successors, or Midori-Denshi MDC-926R
|
||||
.It 0x30000
|
||||
bus-master transfer mode for an ELECOM bus-master SCSI
|
||||
adapter
|
||||
.It 0x40000
|
||||
SMIT transfer mode (for supported adapters only)
|
||||
.It 0x50000
|
||||
bus-master transfer mode for a Logitec LHA-20x series,
|
||||
ICM IF-2766, IF-2766ET, IF-2767 or IF-2769
|
||||
.El
|
||||
.Sh DESCRIPTION
|
||||
The
|
||||
.Nm
|
||||
driver provides access to the
|
||||
.Tn SCSI
|
||||
bus connected to a WD33C93[ABC] based host adapter.
|
||||
.Sh HARDWARE
|
||||
The
|
||||
.Nm
|
||||
driver supports the following adapters:
|
||||
.Pp
|
||||
.Bl -bullet -compact
|
||||
.It
|
||||
ELECOM bus-master
|
||||
.Tn SCSI
|
||||
adapters
|
||||
.It
|
||||
I-O DATA SC-98II
|
||||
.It
|
||||
ICM IF-2660, IF-2766, IF-2766ET, IF-2767 and IF-2769
|
||||
.It
|
||||
Logitec LHA-N151 and LHA-20x series
|
||||
.It
|
||||
Midori-Denshi MDC-554NA and MDC-926R
|
||||
.It
|
||||
NEC PC-9801-55, 92 and compatibles
|
||||
.It
|
||||
SMIT transfer type
|
||||
.Tn SCSI
|
||||
host adapters
|
||||
.It
|
||||
TEXA HA-55BS2 and its later models
|
||||
.El
|
||||
.Sh SEE ALSO
|
||||
.Xr cd 4 ,
|
||||
.Xr ch 4 ,
|
||||
.Xr ctau 4 ,
|
||||
.Xr da 4 ,
|
||||
.Xr intro 4 ,
|
||||
.Xr sa 4 ,
|
||||
.Xr scsi 4
|
||||
.Sh NOTES
|
||||
Historically, the driver for the Cronyx Tau WAN adapters was
|
||||
.Dq ct .
|
||||
This device name was changed to
|
||||
.Dq ctau
|
||||
to avoid conflicts
|
||||
with this pc98
|
||||
.Nm
|
||||
driver.
|
||||
The network device name for
|
||||
.Xr ctau 4
|
||||
is
|
||||
.Dq Li ct .
|
||||
Please see
|
||||
.Xr ctau 4
|
||||
for the details for that device.
|
||||
.Sh HISTORY
|
||||
The
|
||||
.Nm
|
||||
device driver has been developed for
|
||||
.Nx Ns /pc98
|
||||
and ported for
|
||||
.Fx .
|
||||
It first appeared in
|
||||
.Fx 4.4 .
|
||||
.Sh AUTHORS
|
||||
.An -nosplit
|
||||
The
|
||||
.Nm
|
||||
driver was written by
|
||||
.An Naofumi HONDA .
|
||||
.Pp
|
||||
This manual page was written by
|
||||
.An Noriaki MITSUNAGA Aq Mt non@FreeBSD.org
|
||||
and
|
||||
.An Hideyuki KURASHINA Aq Mt rushani@FreeBSD.org .
|
@ -99,8 +99,6 @@ driver supports Ethernet adapters based on the
|
||||
.It
|
||||
3Com 3C562/3C563 PCMCIA
|
||||
.It
|
||||
3Com 3C569B-J-TPO, 3C569B-J-COMBO CBUS
|
||||
.It
|
||||
3Com 3C574, 3C574TX, 3C574-TX, 3CCFE574BT, 3CXFE574BT, 3C3FE574BT PCMCIA
|
||||
.It
|
||||
3Com 3C579-TP, 3C579-BNC EISA
|
||||
|
@ -1,142 +0,0 @@
|
||||
.\"
|
||||
.\" Copyright (c) 2004 Tom Rhodes
|
||||
.\" All rights reserved.
|
||||
.\"
|
||||
.\" Redistribution and use in source and binary forms, with or without
|
||||
.\" modification, are permitted provided that the following conditions
|
||||
.\" are met:
|
||||
.\" 1. Redistributions of source code must retain the above copyright
|
||||
.\" notice, this list of conditions and the following disclaimer.
|
||||
.\" 2. Redistributions in binary form must reproduce the above copyright
|
||||
.\" notice, this list of conditions and the following disclaimer in the
|
||||
.\" documentation and/or other materials provided with the distribution.
|
||||
.\"
|
||||
.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
|
||||
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
|
||||
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
.\" SUCH DAMAGE.
|
||||
.\"
|
||||
.\" $FreeBSD$
|
||||
.\"
|
||||
.Dd September 4, 2004
|
||||
.Dt SNC 4 i386
|
||||
.Os
|
||||
.Sh NAME
|
||||
.Nm snc
|
||||
.Nd National Semiconductor DP8393X SONIC Ethernet adapter driver
|
||||
.Sh SYNOPSIS
|
||||
.Cd device isa
|
||||
.Cd device snc
|
||||
.Sh DESCRIPTION
|
||||
The
|
||||
.Nm
|
||||
driver provides support for the
|
||||
.Tn National
|
||||
.Tn Semiconductor
|
||||
.Tn SONIC
|
||||
Ethernet adapters.
|
||||
.Sh HARDWARE
|
||||
The
|
||||
.Nm
|
||||
driver supports the following cards:
|
||||
.Pp
|
||||
.Bl -bullet -compact
|
||||
.It
|
||||
National Semiconductor DP83934AVQB
|
||||
.It
|
||||
NEC PC-9801-83
|
||||
.It
|
||||
NEC PC-9801-84
|
||||
.It
|
||||
NEC PC-9801-103
|
||||
.It
|
||||
NEC PC-9801-104
|
||||
.It
|
||||
NEC PC-9801N-15
|
||||
.It
|
||||
NEC PC-9801N-25
|
||||
.It
|
||||
NEC PC-9801N-J02 PCMCIA
|
||||
.It
|
||||
NEC PC-9801N-J02R PCMCIA
|
||||
.El
|
||||
.Pp
|
||||
The
|
||||
.Nm
|
||||
driver also includes support for the
|
||||
.Tn National
|
||||
.Tn Semiconductor
|
||||
.Tn NS46C46
|
||||
as
|
||||
64 * 16 bits Microwave Serial
|
||||
.Tn EEPROM .
|
||||
.Sh IMPLEMENTATION NOTES
|
||||
Accessing
|
||||
.Tn SONIC
|
||||
card data structures and registers as 32 bit values
|
||||
makes code endianness independent.
|
||||
The
|
||||
.Tn SONIC
|
||||
is however always in big-endian mode so it is necessary to
|
||||
ensure that data structures shared
|
||||
between the
|
||||
.Tn CPU
|
||||
and the
|
||||
.Tn SONIC
|
||||
card are always in big-endian order.
|
||||
The
|
||||
.Nm
|
||||
driver supports the
|
||||
.Tn PC-98
|
||||
C-Bus,
|
||||
and
|
||||
.Tn PnP
|
||||
buses.
|
||||
Support is also provided for the legacy C-Bus.
|
||||
.Sh DIAGNOSTICS
|
||||
The following driver specific error messages
|
||||
may be reported:
|
||||
.Bl -diag
|
||||
.It "snc%d: snc_nec16_register_irq: unsupported irq (%d)"
|
||||
The card returned an
|
||||
.Tn IRQ
|
||||
which is not supported by the driver.
|
||||
.It "snc%d: invalid packet length %d bytes"
|
||||
An attempt to transfer a data packet failed due to an
|
||||
invalid packet length.
|
||||
.El
|
||||
.Sh SEE ALSO
|
||||
.Xr netintro 4 ,
|
||||
.Xr bus_alloc_resource_any 9
|
||||
.Sh HISTORY
|
||||
The
|
||||
.Nm
|
||||
driver was ported from
|
||||
.Nx
|
||||
by
|
||||
.An -nosplit
|
||||
.An Motomichi Matsuzaki Aq Mt mzaki@e-mail.ne.jp
|
||||
and
|
||||
.An Hiroshi Yamashita Aq Mt bluemoon@msj.biglobe.ne.jp .
|
||||
It first appeared in
|
||||
.Fx 4.2 .
|
||||
This manual page first appeared in
|
||||
.Fx 5.3 .
|
||||
.Sh AUTHORS
|
||||
This manual page was written by
|
||||
.An Tom Rhodes Aq Mt trhodes@FreeBSD.org .
|
||||
.Sh BUGS
|
||||
Currently the
|
||||
.Nm
|
||||
driver only works on the
|
||||
.Tn PC-98
|
||||
architecture.
|
||||
It should probably work on the i386 architecture
|
||||
as well.
|
@ -72,15 +72,6 @@ chips:
|
||||
.It
|
||||
.Tn 53C1510D
|
||||
.El
|
||||
.Pp
|
||||
The following add-on boards are known to be supported:
|
||||
.Pp
|
||||
.Bl -bullet -compact
|
||||
.It
|
||||
I-O DATA SC-98/PCI (PC-98)
|
||||
.It
|
||||
I-O DATA SC-PCI (PC-98)
|
||||
.El
|
||||
.Sh SEE ALSO
|
||||
.Xr cd 4 ,
|
||||
.Xr ch 4 ,
|
||||
|
@ -72,8 +72,6 @@ Macnica Miracle SCSI-II mPS110
|
||||
.It
|
||||
Media Intelligent MSC-110, MSC-200
|
||||
.It
|
||||
NEC PC-9801N-J03R
|
||||
.It
|
||||
New Media Corporation BASICS SCSI
|
||||
.It
|
||||
Qlogic Fast SCSI
|
||||
|
@ -329,10 +329,6 @@ DawiControl DC2976UW
|
||||
.It
|
||||
Diamond FirePort (all)
|
||||
.It
|
||||
I-O DATA SC-UPCI (PC-98)
|
||||
.It
|
||||
Logitec LHA-521UA (PC-98)
|
||||
.It
|
||||
NCR cards (all)
|
||||
.It
|
||||
Symbios cards (all)
|
||||
|
@ -1,7 +1,7 @@
|
||||
.\" DO NOT EDIT-- this file is automatically generated.
|
||||
.\" from FreeBSD: head/tools/build/options/makeman 306729 2016-10-05 20:12:00Z emaste
|
||||
.\" $FreeBSD$
|
||||
.Dd January 6, 2017
|
||||
.Dd January 28, 2017
|
||||
.Dt SRC.CONF 5
|
||||
.Os
|
||||
.Sh NAME
|
||||
@ -177,7 +177,7 @@ Set to build and install binutils (as, ld, objcopy, and objdump) as part
|
||||
of the normal system build.
|
||||
.Pp
|
||||
It is a default setting on
|
||||
amd64/amd64, arm/arm, arm/armeb, arm/armv6, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, pc98/i386, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe and sparc64/sparc64.
|
||||
amd64/amd64, arm/arm, arm/armeb, arm/armv6, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe and sparc64/sparc64.
|
||||
.It Va WITHOUT_BINUTILS_BOOTSTRAP
|
||||
.\" from FreeBSD: head/tools/build/options/WITHOUT_BINUTILS_BOOTSTRAP 295490 2016-02-10 23:57:09Z emaste
|
||||
Set to not build binutils (as, ld, objcopy and objdump)
|
||||
@ -195,7 +195,7 @@ Set build binutils (as, ld, objcopy and objdump)
|
||||
as part of the bootstrap process.
|
||||
.Pp
|
||||
It is a default setting on
|
||||
amd64/amd64, arm/arm, arm/armeb, arm/armv6, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, pc98/i386, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe and sparc64/sparc64.
|
||||
amd64/amd64, arm/arm, arm/armeb, arm/armv6, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe and sparc64/sparc64.
|
||||
.It Va WITHOUT_BLACKLIST
|
||||
.\" from FreeBSD: head/tools/build/options/WITHOUT_BLACKLIST 301554 2016-06-07 16:35:55Z lidl
|
||||
Set this if you do not want to build blacklistd / blacklistctl.
|
||||
@ -352,7 +352,7 @@ When set, it also enforces the following options:
|
||||
Set to build the Clang C/C++ compiler during the normal phase of the build.
|
||||
.Pp
|
||||
It is a default setting on
|
||||
amd64/amd64, arm/arm, arm/armeb, arm/armv6, arm64/aarch64, i386/i386, pc98/i386, powerpc/powerpc, powerpc/powerpc64 and powerpc/powerpcspe.
|
||||
amd64/amd64, arm/arm, arm/armeb, arm/armv6, arm64/aarch64, i386/i386, powerpc/powerpc, powerpc/powerpc64 and powerpc/powerpcspe.
|
||||
.It Va WITHOUT_CLANG_BOOTSTRAP
|
||||
.\" from FreeBSD: head/tools/build/options/WITHOUT_CLANG_BOOTSTRAP 273177 2014-10-16 18:28:11Z skreuzer
|
||||
Set to not build the Clang C/C++ compiler during the bootstrap phase of the build.
|
||||
@ -367,7 +367,7 @@ mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf,
|
||||
Set to build the Clang C/C++ compiler during the bootstrap phase of the build.
|
||||
.Pp
|
||||
It is a default setting on
|
||||
amd64/amd64, arm/arm, arm/armeb, arm/armv6, arm64/aarch64, i386/i386 and pc98/i386.
|
||||
amd64/amd64, arm/arm, arm/armeb, arm/armv6, arm64/aarch64 and i386/i386.
|
||||
.It Va WITH_CLANG_EXTRAS
|
||||
.\" from FreeBSD: head/tools/build/options/WITH_CLANG_EXTRAS 231057 2012-02-05 23:56:22Z dim
|
||||
Set to build additional clang and llvm tools, such as bugpoint.
|
||||
@ -384,7 +384,7 @@ Set to build the ARCMigrate, Rewriter and StaticAnalyzer components of the
|
||||
Clang C/C++ compiler.
|
||||
.Pp
|
||||
It is a default setting on
|
||||
amd64/amd64, arm/arm, arm/armeb, arm/armv6, arm64/aarch64, i386/i386, pc98/i386, powerpc/powerpc, powerpc/powerpc64 and powerpc/powerpcspe.
|
||||
amd64/amd64, arm/arm, arm/armeb, arm/armv6, arm64/aarch64, i386/i386, powerpc/powerpc, powerpc/powerpc64 and powerpc/powerpcspe.
|
||||
.It Va WITHOUT_CLANG_IS_CC
|
||||
.\" from FreeBSD: head/tools/build/options/WITHOUT_CLANG_IS_CC 242629 2012-11-05 21:53:23Z brooks
|
||||
Set to install the GCC compiler as
|
||||
@ -404,7 +404,7 @@ and
|
||||
.Pa /usr/bin/cpp .
|
||||
.Pp
|
||||
It is a default setting on
|
||||
amd64/amd64, arm/arm, arm/armeb, arm/armv6, arm64/aarch64, i386/i386 and pc98/i386.
|
||||
amd64/amd64, arm/arm, arm/armeb, arm/armv6, arm64/aarch64 and i386/i386.
|
||||
.It Va WITHOUT_CPP
|
||||
.\" from FreeBSD: head/tools/build/options/WITHOUT_CPP 156932 2006-03-21 07:50:50Z ru
|
||||
Set to not build
|
||||
@ -652,7 +652,7 @@ and
|
||||
.Xr efivar 8 .
|
||||
.Pp
|
||||
It is a default setting on
|
||||
amd64/amd64, arm/arm, arm/armeb, arm/armv6, arm64/aarch64, i386/i386 and pc98/i386.
|
||||
amd64/amd64, arm/arm, arm/armeb, arm/armv6, arm64/aarch64 and i386/i386.
|
||||
.It Va WITH_EISA
|
||||
.\" from FreeBSD: head/tools/build/options/WITH_EISA 264654 2014-04-18 16:53:06Z imp
|
||||
Set to build EISA kernel modules.
|
||||
@ -726,7 +726,7 @@ Set to not build games.
|
||||
Set to not build and install gcc and g++ as part of the normal build process.
|
||||
.Pp
|
||||
It is a default setting on
|
||||
amd64/amd64, arm/arm, arm/armeb, arm/armv6, arm64/aarch64, i386/i386 and pc98/i386.
|
||||
amd64/amd64, arm/arm, arm/armeb, arm/armv6, arm64/aarch64 and i386/i386.
|
||||
.It Va WITH_GCC
|
||||
.\" from FreeBSD: head/tools/build/options/WITH_GCC 255326 2013-09-06 20:49:48Z zeising
|
||||
Set to build and install gcc and g++.
|
||||
@ -741,7 +741,7 @@ unless an alternative compiler is provided via
|
||||
XCC.
|
||||
.Pp
|
||||
It is a default setting on
|
||||
amd64/amd64, arm/arm, arm/armeb, arm/armv6, arm64/aarch64, i386/i386 and pc98/i386.
|
||||
amd64/amd64, arm/arm, arm/armeb, arm/armv6, arm64/aarch64 and i386/i386.
|
||||
.It Va WITH_GCC_BOOTSTRAP
|
||||
.\" from FreeBSD: head/tools/build/options/WITH_GCC_BOOTSTRAP 264660 2014-04-18 17:03:58Z imp
|
||||
Set to build gcc and g++ as part of the bootstrap process.
|
||||
@ -766,7 +766,7 @@ Set to build
|
||||
.Xr gdb 1 .
|
||||
.Pp
|
||||
It is a default setting on
|
||||
amd64/amd64, arm/arm, arm/armeb, arm/armv6, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, pc98/i386, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe and sparc64/sparc64.
|
||||
amd64/amd64, arm/arm, arm/armeb, arm/armv6, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe and sparc64/sparc64.
|
||||
.It Va WITHOUT_GNU
|
||||
.\" from FreeBSD: head/tools/build/options/WITHOUT_GNU 174550 2007-12-12 16:43:17Z ru
|
||||
Set to not build contributed GNU software as a part of the base system.
|
||||
@ -787,7 +787,7 @@ Do not build the GNU C++ stack (g++, libstdc++).
|
||||
This is the default on platforms where clang is the system compiler.
|
||||
.Pp
|
||||
It is a default setting on
|
||||
amd64/amd64, arm/arm, arm/armeb, arm/armv6, arm64/aarch64, i386/i386 and pc98/i386.
|
||||
amd64/amd64, arm/arm, arm/armeb, arm/armv6, arm64/aarch64 and i386/i386.
|
||||
.It Va WITH_GNUCXX
|
||||
.\" from FreeBSD: head/tools/build/options/WITH_GNUCXX 255321 2013-09-06 20:08:03Z theraven
|
||||
Build the GNU C++ stack (g++, libstdc++).
|
||||
@ -1035,7 +1035,7 @@ library.
|
||||
Set to not build LLVM's lld linker.
|
||||
.Pp
|
||||
It is a default setting on
|
||||
arm/arm, arm/armeb, arm/armv6, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, pc98/i386, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe and sparc64/sparc64.
|
||||
arm/arm, arm/armeb, arm/armv6, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe and sparc64/sparc64.
|
||||
.It Va WITH_LLD
|
||||
.\" from FreeBSD: head/tools/build/options/WITH_LLD 309124 2016-11-24 22:54:55Z dim
|
||||
Set to build LLVM's lld linker.
|
||||
@ -1047,21 +1047,21 @@ amd64/amd64 and arm64/aarch64.
|
||||
Set to not build the LLDB debugger.
|
||||
.Pp
|
||||
It is a default setting on
|
||||
arm/arm, arm/armeb, arm/armv6, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, pc98/i386, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe and sparc64/sparc64.
|
||||
arm/arm, arm/armeb, arm/armv6, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe and sparc64/sparc64.
|
||||
.It Va WITH_LLDB
|
||||
.\" from FreeBSD: head/tools/build/options/WITH_LLDB 255722 2013-09-20 01:52:02Z emaste
|
||||
Set to build the LLDB debugger.
|
||||
.Pp
|
||||
It is a default setting on
|
||||
amd64/amd64 and arm64/aarch64.
|
||||
.It Va WITHOUT_LLD_AS_LD
|
||||
.\" from FreeBSD: head/tools/build/options/WITHOUT_LLD_AS_LD 309142 2016-11-25 13:15:28Z emaste
|
||||
.It Va WITHOUT_LLD_IS_LD
|
||||
.\" from FreeBSD: head/tools/build/options/WITHOUT_LLD_IS_LD 312855 2017-01-27 01:59:12Z emaste
|
||||
Set to use GNU binutils ld as the system linker, instead of LLVM's LLD.
|
||||
.Pp
|
||||
It is a default setting on
|
||||
amd64/amd64, arm/arm, arm/armeb, arm/armv6, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, pc98/i386, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe and sparc64/sparc64.
|
||||
.It Va WITH_LLD_AS_LD
|
||||
.\" from FreeBSD: head/tools/build/options/WITH_LLD_AS_LD 309142 2016-11-25 13:15:28Z emaste
|
||||
amd64/amd64, arm/arm, arm/armeb, arm/armv6, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe and sparc64/sparc64.
|
||||
.It Va WITH_LLD_IS_LD
|
||||
.\" from FreeBSD: head/tools/build/options/WITH_LLD_IS_LD 312855 2017-01-27 01:59:12Z emaste
|
||||
Set to use LLVM's LLD as the system linker, instead of GNU binutils ld.
|
||||
.Pp
|
||||
It is a default setting on
|
||||
@ -1077,7 +1077,7 @@ arm/arm, arm/armeb, arm/armv6, mips/mipsel, mips/mips, mips/mips64el, mips/mips6
|
||||
Set to use LLVM's libunwind stack unwinder (instead of GCC's unwinder).
|
||||
.Pp
|
||||
It is a default setting on
|
||||
amd64/amd64, arm64/aarch64, i386/i386 and pc98/i386.
|
||||
amd64/amd64, arm64/aarch64 and i386/i386.
|
||||
.It Va WITHOUT_LOCALES
|
||||
.\" from FreeBSD: head/tools/build/options/WITHOUT_LOCALES 156932 2006-03-21 07:50:50Z ru
|
||||
Set to not build localization files; see
|
||||
@ -1454,7 +1454,7 @@ mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf,
|
||||
Set to build world with propolice stack smashing protection.
|
||||
.Pp
|
||||
It is a default setting on
|
||||
amd64/amd64, arm/arm, arm/armeb, arm/armv6, arm64/aarch64, i386/i386, pc98/i386, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe and sparc64/sparc64.
|
||||
amd64/amd64, arm/arm, arm/armeb, arm/armv6, arm64/aarch64, i386/i386, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe and sparc64/sparc64.
|
||||
.It Va WITH_STAGING
|
||||
.\" from FreeBSD: head/tools/build/options/WITH_STAGING 290816 2015-11-14 03:24:48Z sjg
|
||||
Enable staging of files to a stage tree.
|
||||
|
@ -24,7 +24,7 @@
|
||||
.\"
|
||||
.\" $FreeBSD$
|
||||
.\"
|
||||
.Dd July 20, 2016
|
||||
.Dd January 28, 2017
|
||||
.Dt BUILD 7
|
||||
.Os
|
||||
.Sh NAME
|
||||
@ -517,10 +517,10 @@ This is analogous to the
|
||||
.Dq Nm uname Fl m
|
||||
output.
|
||||
This is necessary to cross-build some target architectures.
|
||||
For example, cross-building for PC98 machines requires
|
||||
.Va TARGET_ARCH Ns = Ns Li i386
|
||||
For example, cross-building for ARM64 machines requires
|
||||
.Va TARGET_ARCH Ns = Ns Li aarch64
|
||||
and
|
||||
.Va TARGET Ns = Ns Li pc98 .
|
||||
.Va TARGET Ns = Ns Li arm64 .
|
||||
If not set,
|
||||
.Va TARGET
|
||||
defaults to the current hardware platform.
|
||||
|
@ -24,7 +24,7 @@
|
||||
.\"
|
||||
.\" $FreeBSD$
|
||||
.\"
|
||||
.Dd November 20, 2015
|
||||
.Dd January 28, 2017
|
||||
.Dt RELEASE 7
|
||||
.Os
|
||||
.Sh NAME
|
||||
@ -620,10 +620,10 @@ This is analogous to the
|
||||
.Dq Nm uname Fl m
|
||||
output.
|
||||
This is necessary to cross-build some target architectures.
|
||||
For example, cross-building for PC98 machines requires
|
||||
.Ev TARGET_ARCH Ns = Ns Li i386
|
||||
For example, cross-building for ARM64 machines requires
|
||||
.Ev TARGET_ARCH Ns = Ns Li aarch64
|
||||
and
|
||||
.Ev TARGET Ns = Ns Li pc98 .
|
||||
.Ev TARGET Ns = Ns Li arm64 .
|
||||
If not set,
|
||||
.Ev TARGET
|
||||
defaults to the current hardware platform.
|
||||
|
@ -158,6 +158,9 @@ MAN= accept_filter.9 \
|
||||
ieee80211_regdomain.9 \
|
||||
ieee80211_scan.9 \
|
||||
ieee80211_vap.9 \
|
||||
iflibdd.9 \
|
||||
iflibdi.9 \
|
||||
iflibtxrx.9 \
|
||||
ifnet.9 \
|
||||
inittodr.9 \
|
||||
insmntque.9 \
|
||||
|
181
share/man/man9/iflibdd.9
Normal file
181
share/man/man9/iflibdd.9
Normal file
@ -0,0 +1,181 @@
|
||||
.\" $FreeBSD$
|
||||
.Dd January 27, 2017
|
||||
.Dt IFlIBDD(9)
|
||||
.Os
|
||||
.Sh NAME
|
||||
.Nm iflibdd
|
||||
.Nd Device Dependent Configuration Functions
|
||||
.Sh SYNOPSIS
|
||||
.In "ifdi_if.h"
|
||||
.Ss "Soft Queue Setup and Teardown Functions"
|
||||
.Ss "Mandatory Functions"
|
||||
.Ft int
|
||||
.Fn ifdi_queues_alloc "if_ctx_t ctx, caddr_t *vaddrs, uint64_t *paddrs, int nqs"
|
||||
.Ft int
|
||||
.Fn ifdi_queues_free "if_ctx_t ctx"
|
||||
.Ss "Optional Functions"
|
||||
.Ft int
|
||||
.Fn ifdi_txq_setup "if_ctx_t ctx, uint16_t qid"
|
||||
.Ft int
|
||||
.Fn ifdi_rxq_setup "if_ctx_t ctx, uint16_t qid"
|
||||
.Ss "Device Setup and Teardown Functions"
|
||||
.Ss "Mandatory Functions"
|
||||
.Ft int
|
||||
.Fn ifdi_attach_pre "if_ctx_t ctx"
|
||||
.Ft int
|
||||
.Fn ifdi_attach_post "if_ctx_t ctx"
|
||||
.Ft int
|
||||
.Fn ifdi_detach "if_ctx_t ctx"
|
||||
.Ss "Optional Functions"
|
||||
.Ft void
|
||||
.Fn ifdi_vlan_register "if_ctx_t ctx, uint16_t vtag"
|
||||
.Ft void
|
||||
.Fn ifdi_vlan_unregister "if_ctx_t ctx, uint16_t vtag"
|
||||
.Ft int
|
||||
.Fn ifdi_suspend "if_ctx_t ctx"
|
||||
.Ft int
|
||||
.Fn ifdi_resume "if_ctx_t ctx"
|
||||
.Ss "Device Configuration Functions"
|
||||
.Ss "Mandatory Functions"
|
||||
.Ft void
|
||||
.Fn ifdi_init "if_ctx_t ctx"
|
||||
.Ft void
|
||||
.Fn ifdi_stop "if_ctx_t ctx"
|
||||
.Ft void
|
||||
.Fn ifdi_multi_set "if_ctx_t ctx"
|
||||
.Ft int
|
||||
.Fn ifdi_mtu_set "if_ctx_t ctx, uint32_t mtu"
|
||||
.Ft void
|
||||
.Fn ifdi_media_status "if_ctx_t ctx, struct ifmediareq *ifr"
|
||||
.Ft int
|
||||
.Fn ifdi_media_change "if_ctx_t ctx"
|
||||
.Ft void
|
||||
.Fn ifdi_promisc_set "if_ctx_t ctx, int flags"
|
||||
.Ft uint64_t
|
||||
.Fn ifdi_get_counter "if_ctx_t ctx, ift_counter cnt"
|
||||
.Ft void
|
||||
.Fn ifdi_update_admin_status "if_ctx_t ctx"
|
||||
.Ss "Optional Functions"
|
||||
.Ft void
|
||||
.Fn ifdi_media_set "if_ctx_t ctx"
|
||||
.Ss "Interrupt enable/disable"
|
||||
.Ss "Mandatory Functions"
|
||||
.Ft void
|
||||
.Fn ifdi_intr_enable "if_ctx_t ctx"
|
||||
.Ft void
|
||||
.Fn ifdi_queue_intr_enable "if_ctx_t ctx, uint16_t qid"
|
||||
.Ft void
|
||||
.Fn ifdi_intr_disable "if_ctx_t ctx"
|
||||
.Ss IOV Support
|
||||
.Ft init
|
||||
.Fn iov_init "if_ctx_t, uint16_t num_vfs, const nvlist_t *params"
|
||||
.Ft void
|
||||
.Fn iov_uinit "if_ctx_t ctx"
|
||||
.Ft void
|
||||
.Fn ifdi_vflr_handle "if_ctx_t ctx"
|
||||
.Ft int
|
||||
.Fn ifdi_vf_add "if_ctx_t ctx, uint16_t vfnum, const nvlist_t *params"
|
||||
.Ss "Optional Functions"
|
||||
.Ft void
|
||||
.Fn ifdi_link_intr_enable "if_ctx_t ctx"
|
||||
.Ss "Optional Service Routines"
|
||||
.Ft void
|
||||
.Fn ifdi_timer "if_ctx_t ctx"
|
||||
.Ft void
|
||||
.Fn ifdi_watchdog_reset "if_ctx_t ctx"
|
||||
.Ss "Additional Functions"
|
||||
.Ft void
|
||||
.Fn ifdi_led_func "if_ctx_t ctx, int onoff"
|
||||
.Ft int
|
||||
.Fn ifdi_sysctl_int_delay "if_ctx_t ctx, if_int_delay_info_t iidi"
|
||||
.Ft int
|
||||
.Fn ifdi_i2c_req "if_ctx_t ctx, struct ifi2creq *req"
|
||||
.Sh FUNCTIONS
|
||||
The above named functions are device dependent configuration functions. These routines are registerd with iflib by the driver and are called from the corresponding iflib function to configure device specific functions and registers.
|
||||
.Ss Device Dependent Functions
|
||||
.Ss Soft Queue Setup and Teardown
|
||||
.Bl -ohang -offset indent
|
||||
.It Fn ifdi_queues_alloc
|
||||
Manditory queues allocation function that is called during iflib_attach. vaddrs and paddrs are arrays of virtual and physical addresses respectively of the hardware transmit and receive queues, and if relevany, any command completion queues. nqs is the number of queues per qset. For example, a driver with a single receive and transmit queue would have a nqs equal to 2.
|
||||
.It Fn ifdi_queues_free
|
||||
Mandatory function that frees the allocated queues and associated transmit buffers.
|
||||
.It Fn ifdi_txq_setup
|
||||
Optional function for each transmit queue that handles device specific initialization.
|
||||
.It Fn ifdi_rxq_setup
|
||||
Optional function for each receive queue that handles device specific initialization.
|
||||
.El
|
||||
.Ss Device Setup and Teardown
|
||||
.Bl -ohang -offset indent
|
||||
.It Fn ifdi_attach_pre
|
||||
Mandatory function implemented by the driver to perform any attach logic that procedes interrupt and queue allocation, queue setup, and interrupt assignment.
|
||||
.It Fn ifdi_attach_post
|
||||
Mandatory function implemented by the driver to perform any attach logic that occurs after ifdi_attach_pre, and iflib's queue setup and MSI/MSIX(X) or legacy interrupt assignment.
|
||||
.It Fn ifdi_detach
|
||||
Mandatory function that frees any resources allocated by the driver in ifdi_attach_pre and ifdi_attach_post.
|
||||
.It Fn ifdi_vlan_register
|
||||
Optional function called by the VLAN config eventhandler. _vtag is the new VLAN tag.
|
||||
.It Fn ifdi_vlan_unregister
|
||||
Optional function called by the VLAN unconfig eventhandler.
|
||||
.It Fn ifdi_suspend
|
||||
Optional function that suspends the driver.
|
||||
.It Fn ifdi_resume
|
||||
Optional function that resumes a driver.
|
||||
.El
|
||||
.Ss Device Configuration Functions
|
||||
.Bl -ohang -offset indent
|
||||
.It Fn ifdi_init
|
||||
Mandatory function that will initialize and bring up the hardware. For example, it will reset the chip and enable the receiver unit. It should mark the interface running, but not active (IFF_DRV_RUNNING, ~IIF_DRV_OACTIVE).
|
||||
.It Fn ifdi_stop
|
||||
Mandatory function that should disable all traffic on the interface by issuing a global reset on the MAC and deallocating the TX and RX buffers.
|
||||
.It Fn ifdi_multi_set
|
||||
Programs the interfaces multicast addresses
|
||||
.It Fn ifdi_media_status
|
||||
Media Ioctl Callback. Function is called whenever the user queries the status of the interface using ifconfig. The driver sets the appropriate link type and speed in ifmr->ifm_active.
|
||||
.It Fn ifdi_mtu_set
|
||||
Sets the mtu interface to the value of the second function parameter mtu.
|
||||
.It Fn ifdi_media_change
|
||||
Function is called when the user changes speed/duplex using the media/mediaopt option with ifconfig.
|
||||
.It Fn ifdi_promisc_set
|
||||
Enables or disables promisc settings depending upon the flags value. Flags contains the interfaces' ifnet flags.
|
||||
.It Fn ifdi_get_counter
|
||||
Returns the value for counter cnt depending upon counter type.
|
||||
.It Fn ifdi_update_admin_status
|
||||
Sets the link_up state to TRUE or FALSE depending upon the OS link state. A real check of the hardware only happens with a link interrupt.
|
||||
.It Fn ifdi_media_set
|
||||
Need to define
|
||||
.El
|
||||
.Ss Interrupt Enable/Disable
|
||||
.Bl -ohang -offset indent
|
||||
.It Fn ifdi_intr_enable
|
||||
Mandatory function that enables all interrupts.
|
||||
.It Fn ifdi_intr_disable
|
||||
Mandatory function that disables all interrupts.
|
||||
.It Fn ifdi_queue_intr_enable
|
||||
Mandatory function that enables interrupts on queue qid.
|
||||
.It Fn iov_init
|
||||
Initialize num_vfs VFs.
|
||||
.It Fn io_uninit
|
||||
Tear down the context for all VFs.
|
||||
.It Fn ifdi_vflr_handle
|
||||
Handle any VFs that have reset themselves via a Function Level Reset(FLR).
|
||||
.It Fn ifdi_vf_add
|
||||
Set parameters in params in VF vfnum.
|
||||
.El
|
||||
.Ss Service Routines
|
||||
.Bl -ohang -offset indent
|
||||
.It ifdi_timer
|
||||
Optional timer routine that will be run every 500ms.
|
||||
.It ifdi_watchdog_reset
|
||||
Optional function to run when a transmit queue is hung.
|
||||
.El
|
||||
.Ss Additional Functions
|
||||
.Bl -ohang -offset indent
|
||||
.It ifdi_led_func
|
||||
.It ifdi_sysctl_int_delay
|
||||
.It ifdi_i2c_req
|
||||
.El
|
||||
.Sh "SEE ALSO"
|
||||
iflibtxrx(9), iflibdd(9)
|
||||
.Sh AUTHORS
|
||||
This manual page was written by
|
||||
.An Nicole Graziano
|
152
share/man/man9/iflibdi.9
Normal file
152
share/man/man9/iflibdi.9
Normal file
@ -0,0 +1,152 @@
|
||||
.\" $FreeBSD$
|
||||
.Dd January 27, 2017
|
||||
.Dt IFlIBDI(9)
|
||||
.Os
|
||||
.Sh NAME
|
||||
.Nm iflibdi
|
||||
.Nd Device Independent Configuration Functions
|
||||
.Sh SYNOPSIS
|
||||
.In "ifdi_if.h"
|
||||
.Ss "Device Independent Functions"
|
||||
.Ft int
|
||||
.Fn iflib_device_attach "device_t dev"
|
||||
.Ft int
|
||||
.Fn iflib_device_detach "device_t dev"
|
||||
.Ft int
|
||||
.Fn iflib_device_suspend "device_t dev"
|
||||
.Ft int
|
||||
.Fn iflib_device_resume "device_t dev"
|
||||
.Ft int
|
||||
.Fn iflib_device_register "device_t dev, void *softc, if_shared_ctx_t sctx, if_ctx_t *ctxp"
|
||||
.Ft int
|
||||
.Fn iflib_device_deregister "if_ctx_t ctx"
|
||||
.Ft int
|
||||
.Fn iflib_irq_alloc "if_ctx_t ctx, if_irq_t irq_info, int rid, driver_filter_t filter, void *filter_arg, driver_intr_t handler, void *arg, char *name"
|
||||
.Ft int
|
||||
.Fn iflib_irq_alloc_generic "if_ctx_t, ctx, if_irq_t irq, int rid, intr_type_t type, driver_filter_t *filter, void *filter_arg, int qid, char *name"
|
||||
.Ft void
|
||||
.Fn iflib_led_create "if_ctx_t ctx"
|
||||
.Ft void
|
||||
.Fn iflib_tx_intr_deferred "if_ctx_t ctx, int txqid"
|
||||
.Ft void
|
||||
.Fn iflib_rx_intr_deferred "if_ctx_t ctx, int rxqid"
|
||||
.Ft void
|
||||
.Fn iflib_link_intr_deferred "if_ctx_t ctx"
|
||||
.Ft void
|
||||
.Fn iflib_link_state_change "if_ctx_t ctx, int linkstate"
|
||||
.Ft void
|
||||
.Fn iflib_led_create "if_ctx_t ctx"
|
||||
.Ft void
|
||||
.Fn iflib_add_int_delay_sysctl "if_ctx_t ctx, const char *, const char *, if_int_delay_info_t, int, int"
|
||||
.Ss "Global Variables"
|
||||
.Vt extern struct if_txrx
|
||||
.Sh DATA STRUCTURES
|
||||
The \fIif_ctx_t\fP Structure is the device independent data structure that contains statistics and identifying information used to transmit and receive data packets. The interface is associated with an array of queues assigned sequentially. Each queu has its own transmit (iflib_txq_t) and receive (iflib_rxq_t) queue. The transmit queue is used to hold packets while the interface is in the process of sending another. The receive queue is used to receive packets that are awaiting processing.
|
||||
.Pp
|
||||
.Ss The if_ctx_t Structure
|
||||
The fields of
|
||||
.Vt "struct if_ctx_t"
|
||||
are as follows:
|
||||
.Bl -tag -width ".Va if_capabilities" -offset indent
|
||||
.It Va if_softc
|
||||
.Pq Vt "void"
|
||||
A pointer to the driver's private state block.
|
||||
.It Va ifc_dev
|
||||
.Pq Vt "device_t"
|
||||
The underlying device structure.
|
||||
.It Va ifc_ip
|
||||
.Pq Vt "if_t"
|
||||
A link back to the interface structure
|
||||
.It Va ifc_cpus
|
||||
.Pq Vt "cpuset_t"
|
||||
.It Va ifc_mutex
|
||||
.Pq Vt "struct mtx"
|
||||
Mutex lock used to maintain data integrity
|
||||
.It Va ifc_mtx_name
|
||||
.Pq Vt "char *"
|
||||
The name of the mutex
|
||||
.It Va ifc_txqs
|
||||
.Pq Vt "iflib_txq_t"
|
||||
Device independent transmit queue maintained internally by iflib
|
||||
.It Va ifc_rxqs
|
||||
.Pq Vt "iflib_rxq_t"
|
||||
Device independent receive queue maintained internally by iflib
|
||||
.It Va ifc_qsets
|
||||
.Pq Vt "iflib_qset_t"
|
||||
Output queue that contains a single transmit (ifc_txq_t) and receive (ifc_rxq_t) queue
|
||||
.It Va ifc_if_flags
|
||||
.Pq Vt "uint32_t"
|
||||
Flags describing the operational parameter of the interface
|
||||
.It Va ifc_in_detach
|
||||
.Pq Vt "int"
|
||||
.It Va ifc_link_state
|
||||
.Pq Vt "int"
|
||||
Describes the current link state of the Ethernet interface. It's possible values are either active or inactive.
|
||||
.It Va ifc_link_irq
|
||||
.Pq Vt "int"
|
||||
.It Va ifc_vlan_attach_event
|
||||
.Pq Vt "eventhandler_tag"
|
||||
.It Va ifc_vlan_detach_event
|
||||
.Pq Vt "eventhandler_tag"
|
||||
.It Va ifc_pause_frames
|
||||
.Pq Vt "int"
|
||||
.It Va ifc_watchdog_events
|
||||
.Pq Vt "int"
|
||||
.It Va ifc_mac
|
||||
.Pq Vt "uint8_t"
|
||||
.It Va ifc_msix_mem
|
||||
.Pq Vt "struct resource *"
|
||||
.It Va ifc_legacy_irq
|
||||
.Pq Vt "struct if_irq"
|
||||
.It Va ifc_admin_task
|
||||
.Pq Vt "struct grouptask"
|
||||
Taskqueue task scheduled for link state change events of the interface
|
||||
.It Va ifc_filter_info
|
||||
.Pq Vt "struct iflib_filter_info"
|
||||
Statistics and information relating to the interface device filter
|
||||
.It Va ifc_media
|
||||
.Pq Vt "struct ifmedia"
|
||||
.It Va ifc_txrx
|
||||
.Pq Vt "struct if_txrx"
|
||||
.El
|
||||
.Sh FUNCTIONS
|
||||
The above named functions are found exclusively in iflib. They are independent of the underlying hardware type or configuration.
|
||||
.Ss Device Independent Functions
|
||||
.Bl -ohang -offset indent
|
||||
.It Fn iflib_device_attach
|
||||
Function initiates a device registration with the iflib framework. It calls the iflib_register function, which is responsible for allocating and initializing the \fIif_ctx_t\fP structure.
|
||||
.It Fn iflib_device_detach
|
||||
Shutdown and detach the device. Unregister vlan events, drain any dependent tasks, and release irq, pci, and msix memory.
|
||||
.It Fn iflib_device_suspend
|
||||
Suspend a device by calling the device dependent suspend function and bus_generic_suspend.
|
||||
.It Fn iflib_device_resume
|
||||
Resume a device by calling the device dependent resume function, the iflib_init_locked function, and bus_generic_resume.
|
||||
.It Fn iflib_device_register
|
||||
Register a device with the iflib framework. Allocate and initialize the \fIif_ctx_t\fP structure. Setup and initialize the MSI or MSI/X interrupt queues if necessary. Allocate memory for queues and qset structure setup.
|
||||
.It Fn iflib_device_irq_alloc
|
||||
Allocate an interrupt resource for a given rid value with an associated filter and handler function.
|
||||
.It Fn iflib_device_irq_alloc_generic
|
||||
Performs the same function as iflib_device_irq_alloc along with the additional functionality of adding a taskgroup. The data fields and callback function are determined by the type of interrupt, such as IFLIB_INTR_TX, IFLIB_INTR_RX, and IFLIB_INTR_ADMIN.
|
||||
.It Fn iflib_led_create
|
||||
Calls led_create to initialize the ctx->ifc_led_dev field
|
||||
.It Fn iflib_tx_intr_deferred
|
||||
Calls GROUPTASK_ENQUEUE to enqueue the transfer queues ift_task.
|
||||
.It Fn iflib_rx_intr_deferred
|
||||
Calls GROUPTASK_ENQUEUE to enqueue the receive queues ifr_task.
|
||||
.It Fn iflib_link_intr_deferred
|
||||
Calls GROUPTASK_ENQUEUE to enqueue the link task
|
||||
.It Fn iflib_link_state_change
|
||||
Change the interface link status to either LINK_STATE_UP or LINK_STATE_DOWN as specified by the second argument to the function.
|
||||
\fBInterface Link States\fP
|
||||
The following link states are currently defined:
|
||||
|
||||
LINK_STATE_UP The link is up.
|
||||
LINK_STATE_DOWN The link is down.
|
||||
.It Fn iflib_add_int_delay_sysctl
|
||||
Modifies settings to user defined values for a given set of variables.
|
||||
.El
|
||||
.Sh "SEE ALSO"
|
||||
iflibtxrx(9), iflibdd(9)
|
||||
.Sh AUTHORS
|
||||
This manual page was written by
|
||||
.An Nicole Graziano
|
165
share/man/man9/iflibtxrx.9
Normal file
165
share/man/man9/iflibtxrx.9
Normal file
@ -0,0 +1,165 @@
|
||||
.\" $FreeBSD$
|
||||
.Dd January 27, 2017
|
||||
.Dt IFlIBTXTX(9)
|
||||
.Os
|
||||
.Sh NAME
|
||||
.Nm iflibtxrx
|
||||
.Nd Device Dependent Transmit and Receive Functions
|
||||
.Sh SYNOPSIS
|
||||
.In "ifdi_if.h"
|
||||
.Ss "Interface Manipulation Functions"
|
||||
.Ft int
|
||||
.Fn isc_txd_encap "void *sc, if_pkt_into_t pi"
|
||||
.Ft void
|
||||
.Fn isc_txd_flush "void *sc, uint16_t qid, uint32_t _pidx_or_credits_"
|
||||
.Ft int *
|
||||
.Fn isc_txd_credits_update "void *sc, uint16_t qid, uint32_t credits"
|
||||
.Ft int *
|
||||
.Fn isc_rxd_available "void *sc, uint16_t qsid, uint32_t cidx"
|
||||
.Ft void *
|
||||
.Fn isc_rxd_refill "void *sc, uint16_t qsid, uint8_t flid, uint32_t pidx, uint64_t *paddrs, caddr_t *vaddrs, uint16_t count"
|
||||
.Ft void *
|
||||
.Fn isc_rxd_flush "void *sc, uint16_t qsid, uint8_t flid, uint32_t pidx"
|
||||
.Ft int
|
||||
.Fn isc_rxd_pkt_get "void *sc, if_rxd_info_t ri"
|
||||
.Ss "Global Variables"
|
||||
.Vt extern struct if_txrx
|
||||
.Sh DATA STRUCTURES
|
||||
The device dependent mechanisms for handling packet transmit and receive are primarily defined by the functions named above. The if_pkt_info data structure contains statistics and identifying info necessary for packet transmission. While the data structure for packet receipt is the if_rxd_info structure.
|
||||
.Pp
|
||||
.Ss The if_pkt_info Structure
|
||||
The fields of
|
||||
.Vt "struct if_pkt_info"
|
||||
are as follows:
|
||||
.Bl -tag -width ".Va if_capabilities" -offset indent
|
||||
.It Va ipi_len
|
||||
.Pq Vt "uint32_t"
|
||||
Denotes the size of packet to be sent on the transmit queue.
|
||||
.It Va ipi_segs
|
||||
.Pq Vt "bus_dma_segment_t *"
|
||||
A pointer to the bus_dma_segment of the device independent transfer queue defined in iflib.
|
||||
.It Va ipi_qsidx
|
||||
Unique index value assigned sequentially to each transmit queue. Used to reference the currently transmitting queue.
|
||||
.It Va ipi_nsegs
|
||||
.Pq Vt "uint16_t"
|
||||
Number of descriptors to be read into the device dependent transfer descriptors.
|
||||
.It Va ipi_ndescs
|
||||
.Pq Vt "uint16_t"
|
||||
Number of descriptors in use. Calculated by subtracting the old pidx value from the new pidx value.
|
||||
.It Va ipi_flags
|
||||
.Pq Vt "uint16_t"
|
||||
Flags defined on a per packet basis.
|
||||
.It Va ipi_pidx
|
||||
.Pq Vt "uint32_t"
|
||||
Value of first pidx sent to the isc_encap function for encapsulation and subsequent transmission.
|
||||
.It Va ipi_new_pidx
|
||||
.Pq Vt "uint32_t"
|
||||
Value set after the termination of the isc_encap function. This value will become the first pidx sent to the isc-encap the next time that the function is called.
|
||||
.It Va \fBThe Following Fields Are Used For Offload Handling\fP
|
||||
.It Va ipi_csum_flags
|
||||
.Pq Vt "uint64_t"
|
||||
Flags describing the checksum values. Used on a per packet basis.
|
||||
.It Va ipi_tso_segsz
|
||||
.Pq Vt "uint16_t"
|
||||
Size of the TSO Segment Size.
|
||||
.It Va ipi_mflags
|
||||
.Pq Vt "uint16_t"
|
||||
Flags describing the operational parameters of the mbuf.
|
||||
.It Va ipi_vtag
|
||||
.Pq Vt "uint16_t"
|
||||
Contains the VLAN information in the Ethernet Frame.
|
||||
.It Va ipi_etype
|
||||
.Pq Vt "uint16_t"
|
||||
Type of ethernet header protocol as contained by the struct ether_vlan_header.
|
||||
.It Va ipi_ehrdlen
|
||||
.Pq Vt "uint8_t"
|
||||
Length of the Ethernet Header.
|
||||
.It Va ipi_ip_hlen
|
||||
.Pq Vt "uint8_t"
|
||||
Length of the TCP Header
|
||||
.It Va ipi_tcp_hlen
|
||||
.Pq Vt "uint8_t"
|
||||
Length of the TCP Header.
|
||||
.It Va ipi_tcp_hflags
|
||||
.Pq Vt "uint8_t"
|
||||
Flags describing the operational parameters of the TCP Header.
|
||||
.It Va ipi_ipproto
|
||||
.Pq Vt "uint8_t"
|
||||
Specifies the type of IP Protocol in use. Example TCP, UDP, or SCTP.
|
||||
.El
|
||||
.Ss The if_rxd_info Structure
|
||||
The fields of
|
||||
.Vt "struct if_rxd_info"
|
||||
are as follows:
|
||||
.Bl -tag -width ".Va if_capabilities" -offset indent
|
||||
.It Va iri_qsidx
|
||||
.Pq Vt "uint16_t"
|
||||
Unique index value assigned sequentially to each receive queue. Used to reference the currently receiving queue.
|
||||
.It Va iri_vtag
|
||||
.Pq Vt "uint16_t"
|
||||
Contains the VLAN information in the Ethernet Frame.
|
||||
.It Va iri_len
|
||||
.Pq Vt "uint16_t"
|
||||
Denotes the size of a received packet.
|
||||
.It Va iri_next_offset
|
||||
.Pq Vt "uint16_t"
|
||||
Denotes the offset value for the next packet to be receive. A Null value signifies the end of packet.
|
||||
.It Va iri_cidx
|
||||
.Pq Vt "uint32_t"
|
||||
Denotes the index value of the packet currently being processed in the consumer queue.
|
||||
.It Va iri_flowid
|
||||
.Pq Vt "uint32_t"
|
||||
Value of the RSS hash for the packet.
|
||||
.It Va iri_flags
|
||||
.Pq Vt "uint"
|
||||
Flags describing the operational parameters of the mbuf contained in the receive packet.
|
||||
.It Va iri_csum_flags
|
||||
.Pq Vt "uint32_t"
|
||||
Flags describing the checksum value contained in the receive packet.
|
||||
.It Va iri_csum_data
|
||||
.Pq Vt "uint32_t"
|
||||
Checksum data contained in the mbuf packet header.
|
||||
.It Va iri_m
|
||||
.Pq Vt "struct mbuf *"
|
||||
A mbuf for drivers that manage their own receive queues.
|
||||
.It Va iri_ifp
|
||||
.Pq Vt "struct ifnet *"
|
||||
A link back to the interface structure. Utilized by drivers that have multiple interface per softc.
|
||||
.It Va iri_rsstype
|
||||
.Pq Vt "uint8_t"
|
||||
The value of the RSS hash type.
|
||||
.It Va iri_pad
|
||||
.Pq Vt "uint8_t"
|
||||
The length of any padding contained by the received data.
|
||||
.It Va iri_qidx
|
||||
.Pq Vt "uint8_t"
|
||||
Represents the type of queue event. If value >= 0 then it is the freelist id otherwise it is a completion queue event.
|
||||
.El
|
||||
.Sh FUNCTIONS
|
||||
All function calls are associated exclusively with either packet transmission or receipt.
|
||||
The void *sc passed as the first arguement to all of the following functions repressents the driver's softc.
|
||||
.Ss Transmit Packet Functions
|
||||
.Bl -ohang -offset indent
|
||||
.It Fn isc_txd_encap
|
||||
Transmit function that sends a packet on an interface. The if_pkt_info data structure contains data information fields describing the packet. This function returns 0 if successful, otherwise an error value is returned.
|
||||
.It Fn isc_txd_flush
|
||||
Flush function is called immediately after the isc_txd_encap function transmits a packet. It updates the hardware producer index or increments the descriptors used to pidx_or_credits in the queue designated by the qid number. This is often referred to as poking the doorbell register.
|
||||
.It Fn isc_txd_credits_update
|
||||
Credit function advances the buffer ring and calculates the credits (descriptors) processed. Until the I/O is complete it cleans the range in case of multisegments and updates the count of processed packets. The function returns the number of processed credits.
|
||||
.El
|
||||
.Ss Receive Packet Functions
|
||||
.Bl -ohang -offset indent
|
||||
.It Fn isc_rxd_available
|
||||
Function calculates the remaining number of descriptors from a position given by idx. The function returns this value.
|
||||
.It Fn isc_rxd_refill
|
||||
Starting with the physical address paddrs, the function reads a packet into the rx_ring until a value designated by count is reached. vaddrs is typically not needed and is provided for devices that place their own metadata in the packet header.
|
||||
.It Fn isc_rxd_flush
|
||||
Flush function updates the producer pointer on the free list flid in queue set number qid to pidx to reflect the presence of new buffers.
|
||||
.It Fn isc_rxd_pkt_get
|
||||
Process a single software descriptor. rxr->rx_base[i] contains a descriptor that describes a received packet. Hardware specific information about the buffer referred to by ri is returned in the data structure if_rxd_info
|
||||
.El
|
||||
.Sh "SEE ALSO"
|
||||
iflibdd(9), iflibdi(9)
|
||||
.Sh AUTHORS
|
||||
This manual page was written by
|
||||
.An Nicole Graziano
|
@ -18,9 +18,6 @@ CFLAGS.gcc+= -mpreferred-stack-boundary=2
|
||||
.if ${MACHINE_CPUARCH} == "amd64"
|
||||
CFLAGS+= -fPIC -mno-red-zone
|
||||
.endif
|
||||
.if ${MACHINE} == "pc98"
|
||||
CFLAGS+= -Os
|
||||
.endif
|
||||
.if ${MACHINE_CPUARCH} == "aarch64"
|
||||
CFLAGS+= -mgeneral-regs-only
|
||||
.endif
|
||||
|
@ -47,7 +47,6 @@ TARGET_ARCHES_arm?= arm armeb armv6
|
||||
TARGET_ARCHES_arm64?= aarch64
|
||||
TARGET_ARCHES_mips?= mipsel mips mips64el mips64 mipsn32 mipsn32el
|
||||
TARGET_ARCHES_powerpc?= powerpc powerpc64 powerpcspe
|
||||
TARGET_ARCHES_pc98?= i386
|
||||
TARGET_ARCHES_riscv?= riscv64 riscv64sf
|
||||
|
||||
# some corner cases
|
||||
@ -55,7 +54,7 @@ BOOT_MACHINE_DIR.amd64 = boot/i386
|
||||
MACHINE_ARCH.host = ${_HOST_ARCH}
|
||||
|
||||
# the list of machines we support
|
||||
ALL_MACHINE_LIST?= amd64 arm arm64 i386 mips pc98 powerpc riscv sparc64
|
||||
ALL_MACHINE_LIST?= amd64 arm arm64 i386 mips powerpc riscv sparc64
|
||||
.for m in ${ALL_MACHINE_LIST:O:u}
|
||||
MACHINE_ARCH_LIST.$m?= ${TARGET_ARCHES_${m}:U$m}
|
||||
MACHINE_ARCH.$m?= ${MACHINE_ARCH_LIST.$m:[1]}
|
||||
|
@ -294,20 +294,6 @@ jp.106x.kbd:pt:Japon
|
||||
jp.106x.kbd:es:Japonés 106x
|
||||
jp.106x.kbd:uk:ñÐÏÎÓØËÁ 106x
|
||||
|
||||
jp.pc98.kbd:en:Japanese PC-98x1
|
||||
jp.pc98.kbd:de:Japanisch PC-98x1
|
||||
jp.pc98.kbd:fr:Japonais PC-98x1
|
||||
jp.pc98.kbd:pt:Japonês PC-98x1
|
||||
jp.pc98.kbd:es:Japonés PC-98x1
|
||||
jp.pc98.kbd:uk:ñÐÏÎÓØËÁ PC-98x1
|
||||
|
||||
jp.pc98.iso.kbd:en:Japanese PC-98x1 (ISO)
|
||||
jp.pc98.iso.kbd:de:Japanisch PC-98x1 (ISO)
|
||||
jp.pc98.iso.kbd:fr:Japonais PC-98x1 (ISO)
|
||||
jp.pc98.iso.kbd:pt:Japonês PC-98x1 (ISO)
|
||||
jp.pc98.iso.kbd:es:Japonés PC-98x1 (ISO)
|
||||
jp.pc98.iso.kbd:uk:ñÐÏÎÓØËÁ PC-98x1 (ISO)
|
||||
|
||||
kk.pt154.kst.kbd:en:Kazakh PT154 codepage
|
||||
kk.pt154.kst.kbd:de:Kasachisch PT154 codepage
|
||||
kk.pt154.kst.kbd:fr:Kazakh PT154 code page
|
||||
|
@ -26,7 +26,7 @@ FILES= INDEX.keymaps \
|
||||
icelandic.iso.kbd icelandic.iso.acc.kbd \
|
||||
it.iso.kbd \
|
||||
iw.iso8.kbd \
|
||||
jp.106.kbd jp.106x.kbd jp.pc98.kbd jp.pc98.iso.kbd \
|
||||
jp.106.kbd jp.106x.kbd \
|
||||
kk.pt154.kst.kbd kk.pt154.io.kbd \
|
||||
latinamerican.kbd latinamerican.iso.acc.kbd \
|
||||
lt.iso4.kbd \
|
||||
|
@ -1,134 +0,0 @@
|
||||
# $FreeBSD$
|
||||
# alt
|
||||
# scan cntrl alt alt cntrl lock
|
||||
# code base shift cntrl shift alt shift cntrl shift state
|
||||
# ------------------------------------------------------------------
|
||||
000 esc esc esc esc esc esc debug esc O
|
||||
001 '1' '!' '!' '!' '1' '!' '!' '!' O
|
||||
002 '2' '@' sub sub '2' '"' nul nul O
|
||||
003 '3' '#' esc esc '3' '#' esc esc O
|
||||
004 '4' '$' fs fs '4' '$' fs fs O
|
||||
005 '5' '%' gs gs '5' '%' gs gs O
|
||||
006 '6' '^' rs rs '6' '&' rs rs O
|
||||
007 '7' '&' '&' '&' '7' ''' us us O
|
||||
008 '8' '*' bs bs '8' '(' del del O
|
||||
009 '9' '(' '(' '(' '9' ')' '9' '9' O
|
||||
010 '0' ')' ')' ')' '0' nop '0' '0' O
|
||||
011 '-' '_' us us '-' '=' '-' '-' O
|
||||
012 '=' '+' '+' '+' '^' '`' rs rs O
|
||||
013 '\' '|' fs fs '\' '|' fs fs O
|
||||
014 bs bs bs bs bs bs bs bs O
|
||||
015 ht btab ht btab ht btab ht btab O
|
||||
016 'q' 'Q' dc1 dc1 'q' 'Q' dc1 dc1 C
|
||||
017 'w' 'W' etb etb 'w' 'W' etb etb C
|
||||
018 'e' 'E' enq enq 'e' 'E' enq enq C
|
||||
019 'r' 'R' dc2 dc2 'r' 'R' dc2 dc2 C
|
||||
020 't' 'T' dc4 dc4 't' 'T' dc4 dc4 C
|
||||
021 'y' 'Y' em em 'y' 'Y' em em C
|
||||
022 'u' 'U' nak nak 'u' 'U' nak nak C
|
||||
023 'i' 'I' ht ht 'i' 'I' ht ht C
|
||||
024 'o' 'O' si si 'o' 'O' si si C
|
||||
025 'p' 'P' dle dle 'p' 'P' dle dle C
|
||||
026 '[' '{' esc esc '@' '~' nul nul O
|
||||
027 ']' '}' gs gs '[' '{' esc esc O
|
||||
028 cr cr nl nl cr cr nl nl O
|
||||
029 'a' 'A' soh soh 'a' 'A' soh soh C
|
||||
030 's' 'S' dc3 dc3 's' 'S' dc3 dc3 C
|
||||
031 'd' 'D' eot eot 'd' 'D' eot eot C
|
||||
032 'f' 'F' ack ack 'f' 'F' ack ack C
|
||||
033 'g' 'G' bel bel 'g' 'G' bel bel C
|
||||
034 'h' 'H' bs bs 'h' 'H' bs bs C
|
||||
035 'j' 'J' nl nl 'j' 'J' nl nl C
|
||||
036 'k' 'K' vt vt 'k' 'K' vt vt C
|
||||
037 'l' 'L' ff ff 'l' 'L' ff ff C
|
||||
038 ';' ':' ';' ';' ';' '+' ';' ';' O
|
||||
039 ''' '"' ''' ''' ':' '*' ':' ':' O
|
||||
040 '`' '~' '~' '~' ']' '}' gs gs O
|
||||
041 'z' 'Z' sub sub 'z' 'Z' sub sub C
|
||||
042 'x' 'X' can can 'x' 'X' can can C
|
||||
043 'c' 'C' etx etx 'c' 'C' etx etx C
|
||||
044 'v' 'V' syn syn 'v' 'V' syn syn C
|
||||
045 'b' 'B' stx stx 'b' 'B' stx stx C
|
||||
046 'n' 'N' so so 'n' 'N' so so C
|
||||
047 'm' 'M' cr cr 'm' 'M' cr cr C
|
||||
048 ',' '<' '<' '<' ',' '<' '<' '<' O
|
||||
049 '.' '>' '>' '>' '.' '>' '>' '>' O
|
||||
050 '/' '?' del del '/' '?' del del O
|
||||
051 '\' '|' fs fs nop '_' us us O
|
||||
052 ' ' ' ' nul nul ' ' ' ' nul nul O
|
||||
053 esc esc esc esc esc esc esc esc O
|
||||
054 fkey59 fkey59 fkey59 fkey59 fkey59 fkey59 fkey59 fkey59 O
|
||||
055 fkey51 fkey51 fkey51 fkey51 fkey51 fkey51 fkey51 fkey51 O
|
||||
056 fkey60 fkey60 fkey60 fkey60 fkey60 fkey60 fkey60 fkey60 O
|
||||
057 del del del del del del boot boot N
|
||||
058 fkey50 fkey50 fkey50 fkey50 fkey50 fkey50 fkey50 fkey50 O
|
||||
059 fkey53 fkey53 fkey53 fkey53 fkey53 fkey53 fkey53 fkey53 O
|
||||
060 fkey55 fkey55 fkey55 fkey55 fkey55 fkey55 fkey55 fkey55 O
|
||||
061 fkey58 fkey58 fkey58 fkey58 fkey58 fkey58 fkey58 fkey58 O
|
||||
062 fkey49 fkey49 fkey49 fkey49 fkey49 fkey49 fkey49 fkey49 O
|
||||
063 fkey57 fkey57 fkey57 fkey57 fkey57 fkey57 fkey57 fkey57 O
|
||||
064 '-' '-' '-' '-' '-' '-' '-' '-' O
|
||||
065 '/' '/' '/' '/' '/' '/' '/' '/' O
|
||||
066 '7' '7' '7' '7' '7' '7' '7' '7' O
|
||||
067 '8' '8' '8' '8' '8' '8' '8' '8' O
|
||||
068 '9' '9' '9' '9' '9' '9' '9' '9' O
|
||||
069 '*' '*' '*' '*' '*' '*' '*' '*' O
|
||||
070 '4' '4' '4' '4' '4' '4' '4' '4' O
|
||||
071 '5' '5' '5' '5' '5' '5' '5' '5' O
|
||||
072 '6' '6' '6' '6' '6' '6' '6' '6' O
|
||||
073 '+' '+' '+' '+' '+' '+' '+' '+' O
|
||||
074 '1' '1' '1' '1' '1' '1' '1' '1' O
|
||||
075 '2' '2' '2' '2' '2' '2' '2' '2' O
|
||||
076 '3' '3' '3' '3' '3' '3' '3' '3' O
|
||||
077 '=' '=' '=' '=' '=' '=' '=' '=' O
|
||||
078 '0' '0' '0' '0' '0' '0' '0' '0' O
|
||||
079 ',' ',' ',' ',' ',' ',' ',' ',' O
|
||||
080 '.' '.' '.' '.' '.' '.' '.' '.' O
|
||||
081 meta meta meta meta meta meta meta meta O
|
||||
082 fkey11 fkey23 fkey35 fkey47 scr11 scr11 scr11 scr11 O
|
||||
083 fkey12 fkey24 fkey36 fkey48 scr12 scr12 scr12 scr12 O
|
||||
084 slock slock slock slock slock slock slock slock O
|
||||
085 nop nop nop nop nop nop nop nop O
|
||||
086 nop nop nop nop nop nop nop nop O
|
||||
087 nop nop nop nop nop nop nop nop O
|
||||
088 nop nop nop nop nop nop nop nop O
|
||||
089 nop nop nop nop nop nop nop nop O
|
||||
090 nop nop nop nop nop nop nop nop O
|
||||
091 nop nop nop nop nop nop nop nop O
|
||||
092 nop nop nop nop nop nop nop nop O
|
||||
093 nop nop nop nop nop nop nop nop O
|
||||
094 nop nop nop nop nop nop nop nop O
|
||||
095 nop nop nop nop nop nop nop nop O
|
||||
096 slock saver slock saver susp nop susp nop O
|
||||
097 nscr nscr debug debug nop nop nop nop O
|
||||
098 fkey01 fkey13 fkey25 fkey37 scr01 scr01 scr01 scr01 O
|
||||
099 fkey02 fkey14 fkey26 fkey38 scr02 scr02 scr02 scr02 O
|
||||
100 fkey03 fkey15 fkey27 fkey39 scr03 scr03 scr03 scr03 O
|
||||
101 fkey04 fkey16 fkey28 fkey40 scr04 scr04 scr04 scr04 O
|
||||
102 fkey05 fkey17 fkey29 fkey41 scr05 scr05 scr05 scr05 O
|
||||
103 fkey06 fkey18 fkey30 fkey42 scr06 scr06 scr06 scr06 O
|
||||
104 fkey07 fkey19 fkey31 fkey43 scr07 scr07 scr07 scr07 O
|
||||
105 fkey08 fkey20 fkey32 fkey44 scr08 scr08 scr08 scr08 O
|
||||
106 fkey09 fkey21 fkey33 fkey45 scr09 scr09 scr09 scr09 O
|
||||
107 fkey10 fkey22 fkey34 fkey46 scr10 scr10 scr10 scr10 O
|
||||
108 nop nop nop nop nop nop nop nop O
|
||||
109 nop nop nop nop nop nop nop nop O
|
||||
110 nop nop nop nop nop nop nop nop O
|
||||
111 nop nop nop nop nop nop nop nop O
|
||||
112 lshift lshift lshift lshift lshift lshift lshift lshift O
|
||||
113 clock clock clock clock clock clock clock clock O
|
||||
114 lalt lalt lalt lalt lalt lalt lalt lalt O
|
||||
115 lalt lalt lalt lalt lalt lalt lalt lalt O
|
||||
116 lctrl lctrl lctrl lctrl lctrl lctrl lctrl lctrl O
|
||||
117 nop nop nop nop nop nop nop nop O
|
||||
118 nop nop nop nop nop nop nop nop O
|
||||
119 nop nop nop nop nop nop nop nop O
|
||||
120 nop nop nop nop nop nop nop nop O
|
||||
121 nop nop nop nop nop nop nop nop O
|
||||
122 nop nop nop nop nop nop nop nop O
|
||||
123 nop nop nop nop nop nop nop nop O
|
||||
124 nop nop nop nop nop nop nop nop O
|
||||
125 nop nop nop nop nop nop nop nop O
|
||||
126 nop nop nop nop nop nop nop nop O
|
||||
127 nop nop nop nop nop nop nop nop O
|
||||
|
@ -1,134 +0,0 @@
|
||||
# $FreeBSD$
|
||||
# alt
|
||||
# scan cntrl alt alt cntrl lock
|
||||
# code base shift cntrl shift alt shift cntrl shift state
|
||||
# ------------------------------------------------------------------
|
||||
000 esc esc esc esc esc esc debug esc O
|
||||
001 '1' '!' '!' '!' '1' '!' '!' '!' O
|
||||
002 '2' '"' sub sub '2' '@' nul nul O
|
||||
003 '3' '#' esc esc '3' '#' esc esc O
|
||||
004 '4' '$' fs fs '4' '$' fs fs O
|
||||
005 '5' '%' gs gs '5' '%' gs gs O
|
||||
006 '6' '&' rs rs '6' '^' rs rs O
|
||||
007 '7' ''' us us '7' '&' '&' '&' O
|
||||
008 '8' '(' del del '8' '*' bs bs O
|
||||
009 '9' ')' '9' '9' '9' '(' '(' '(' O
|
||||
010 '0' nop '0' '0' '0' ')' ')' ')' O
|
||||
011 '-' '=' '-' '-' '-' '_' us us O
|
||||
012 '^' '`' rs rs '=' '+' '+' '+' O
|
||||
013 '\' '|' fs fs '\' '|' fs fs O
|
||||
014 bs bs bs bs bs bs bs bs O
|
||||
015 ht btab ht btab ht btab ht btab O
|
||||
016 'q' 'Q' dc1 dc1 'q' 'Q' dc1 dc1 C
|
||||
017 'w' 'W' etb etb 'w' 'W' etb etb C
|
||||
018 'e' 'E' enq enq 'e' 'E' enq enq C
|
||||
019 'r' 'R' dc2 dc2 'r' 'R' dc2 dc2 C
|
||||
020 't' 'T' dc4 dc4 't' 'T' dc4 dc4 C
|
||||
021 'y' 'Y' em em 'y' 'Y' em em C
|
||||
022 'u' 'U' nak nak 'u' 'U' nak nak C
|
||||
023 'i' 'I' ht ht 'i' 'I' ht ht C
|
||||
024 'o' 'O' si si 'o' 'O' si si C
|
||||
025 'p' 'P' dle dle 'p' 'P' dle dle C
|
||||
026 '@' '~' nul nul '[' '{' esc esc O
|
||||
027 '[' '{' esc esc ']' '}' gs gs O
|
||||
028 cr cr nl nl cr cr nl nl O
|
||||
029 'a' 'A' soh soh 'a' 'A' soh soh C
|
||||
030 's' 'S' dc3 dc3 's' 'S' dc3 dc3 C
|
||||
031 'd' 'D' eot eot 'd' 'D' eot eot C
|
||||
032 'f' 'F' ack ack 'f' 'F' ack ack C
|
||||
033 'g' 'G' bel bel 'g' 'G' bel bel C
|
||||
034 'h' 'H' bs bs 'h' 'H' bs bs C
|
||||
035 'j' 'J' nl nl 'j' 'J' nl nl C
|
||||
036 'k' 'K' vt vt 'k' 'K' vt vt C
|
||||
037 'l' 'L' ff ff 'l' 'L' ff ff C
|
||||
038 ';' '+' ';' ';' ';' ':' ';' ';' O
|
||||
039 ':' '*' ':' ':' ''' '"' ''' ''' O
|
||||
040 ']' '}' gs gs '`' '~' '~' '~' O
|
||||
041 'z' 'Z' sub sub 'z' 'Z' sub sub C
|
||||
042 'x' 'X' can can 'x' 'X' can can C
|
||||
043 'c' 'C' etx etx 'c' 'C' etx etx C
|
||||
044 'v' 'V' syn syn 'v' 'V' syn syn C
|
||||
045 'b' 'B' stx stx 'b' 'B' stx stx C
|
||||
046 'n' 'N' so so 'n' 'N' so so C
|
||||
047 'm' 'M' cr cr 'm' 'M' cr cr C
|
||||
048 ',' '<' '<' '<' ',' '<' '<' '<' O
|
||||
049 '.' '>' '>' '>' '.' '>' '>' '>' O
|
||||
050 '/' '?' del del '/' '?' del del O
|
||||
051 nop '_' us us '\' '|' fs fs O
|
||||
052 ' ' ' ' nul nul ' ' ' ' nul nul O
|
||||
053 esc esc esc esc esc esc esc esc O
|
||||
054 fkey59 fkey59 fkey59 fkey59 fkey59 fkey59 fkey59 fkey59 O
|
||||
055 fkey51 fkey51 fkey51 fkey51 fkey51 fkey51 fkey51 fkey51 O
|
||||
056 fkey60 fkey60 fkey60 fkey60 fkey60 fkey60 fkey60 fkey60 O
|
||||
057 del del del del del del boot boot N
|
||||
058 fkey50 fkey50 fkey50 fkey50 fkey50 fkey50 fkey50 fkey50 O
|
||||
059 fkey53 fkey53 fkey53 fkey53 fkey53 fkey53 fkey53 fkey53 O
|
||||
060 fkey55 fkey55 fkey55 fkey55 fkey55 fkey55 fkey55 fkey55 O
|
||||
061 fkey58 fkey58 fkey58 fkey58 fkey58 fkey58 fkey58 fkey58 O
|
||||
062 fkey49 fkey49 fkey49 fkey49 fkey49 fkey49 fkey49 fkey49 O
|
||||
063 fkey57 fkey57 fkey57 fkey57 fkey57 fkey57 fkey57 fkey57 O
|
||||
064 '-' '-' '-' '-' '-' '-' '-' '-' O
|
||||
065 '/' '/' '/' '/' '/' '/' '/' '/' O
|
||||
066 '7' '7' '7' '7' '7' '7' '7' '7' O
|
||||
067 '8' '8' '8' '8' '8' '8' '8' '8' O
|
||||
068 '9' '9' '9' '9' '9' '9' '9' '9' O
|
||||
069 '*' '*' '*' '*' '*' '*' '*' '*' O
|
||||
070 '4' '4' '4' '4' '4' '4' '4' '4' O
|
||||
071 '5' '5' '5' '5' '5' '5' '5' '5' O
|
||||
072 '6' '6' '6' '6' '6' '6' '6' '6' O
|
||||
073 '+' '+' '+' '+' '+' '+' '+' '+' O
|
||||
074 '1' '1' '1' '1' '1' '1' '1' '1' O
|
||||
075 '2' '2' '2' '2' '2' '2' '2' '2' O
|
||||
076 '3' '3' '3' '3' '3' '3' '3' '3' O
|
||||
077 '=' '=' '=' '=' '=' '=' '=' '=' O
|
||||
078 '0' '0' '0' '0' '0' '0' '0' '0' O
|
||||
079 ',' ',' ',' ',' ',' ',' ',' ',' O
|
||||
080 '.' '.' '.' '.' '.' '.' '.' '.' O
|
||||
081 meta meta meta meta meta meta meta meta O
|
||||
082 fkey11 fkey23 fkey35 fkey47 scr11 scr11 scr11 scr11 O
|
||||
083 fkey12 fkey24 fkey36 fkey48 scr12 scr12 scr12 scr12 O
|
||||
084 slock slock slock slock slock slock slock slock O
|
||||
085 nop nop nop nop nop nop nop nop O
|
||||
086 nop nop nop nop nop nop nop nop O
|
||||
087 nop nop nop nop nop nop nop nop O
|
||||
088 nop nop nop nop nop nop nop nop O
|
||||
089 nop nop nop nop nop nop nop nop O
|
||||
090 nop nop nop nop nop nop nop nop O
|
||||
091 nop nop nop nop nop nop nop nop O
|
||||
092 nop nop nop nop nop nop nop nop O
|
||||
093 nop nop nop nop nop nop nop nop O
|
||||
094 nop nop nop nop nop nop nop nop O
|
||||
095 nop nop nop nop nop nop nop nop O
|
||||
096 slock saver slock saver susp nop susp nop O
|
||||
097 nscr nscr debug debug nop nop nop nop O
|
||||
098 fkey01 fkey13 fkey25 fkey37 scr01 scr01 scr01 scr01 O
|
||||
099 fkey02 fkey14 fkey26 fkey38 scr02 scr02 scr02 scr02 O
|
||||
100 fkey03 fkey15 fkey27 fkey39 scr03 scr03 scr03 scr03 O
|
||||
101 fkey04 fkey16 fkey28 fkey40 scr04 scr04 scr04 scr04 O
|
||||
102 fkey05 fkey17 fkey29 fkey41 scr05 scr05 scr05 scr05 O
|
||||
103 fkey06 fkey18 fkey30 fkey42 scr06 scr06 scr06 scr06 O
|
||||
104 fkey07 fkey19 fkey31 fkey43 scr07 scr07 scr07 scr07 O
|
||||
105 fkey08 fkey20 fkey32 fkey44 scr08 scr08 scr08 scr08 O
|
||||
106 fkey09 fkey21 fkey33 fkey45 scr09 scr09 scr09 scr09 O
|
||||
107 fkey10 fkey22 fkey34 fkey46 scr10 scr10 scr10 scr10 O
|
||||
108 nop nop nop nop nop nop nop nop O
|
||||
109 nop nop nop nop nop nop nop nop O
|
||||
110 nop nop nop nop nop nop nop nop O
|
||||
111 nop nop nop nop nop nop nop nop O
|
||||
112 lshift lshift lshift lshift lshift lshift lshift lshift O
|
||||
113 clock clock clock clock clock clock clock clock O
|
||||
114 lalt lalt lalt lalt lalt lalt lalt lalt O
|
||||
115 lalt lalt lalt lalt lalt lalt lalt lalt O
|
||||
116 lctrl lctrl lctrl lctrl lctrl lctrl lctrl lctrl O
|
||||
117 nop nop nop nop nop nop nop nop O
|
||||
118 nop nop nop nop nop nop nop nop O
|
||||
119 nop nop nop nop nop nop nop nop O
|
||||
120 nop nop nop nop nop nop nop nop O
|
||||
121 nop nop nop nop nop nop nop nop O
|
||||
122 nop nop nop nop nop nop nop nop O
|
||||
123 nop nop nop nop nop nop nop nop O
|
||||
124 nop nop nop nop nop nop nop nop O
|
||||
125 nop nop nop nop nop nop nop nop O
|
||||
126 nop nop nop nop nop nop nop nop O
|
||||
127 nop nop nop nop nop nop nop nop O
|
||||
|
@ -301,20 +301,6 @@ jp.capsctrl.kbd:pt:Japonês 106x
|
||||
jp.capsctrl.kbd:es:Japonés 106x
|
||||
jp.capsctrl.kbd:uk:Японська 106x
|
||||
|
||||
jp.pc98.kbd:en:Japanese PC-98x1
|
||||
jp.pc98.kbd:de:Japanisch PC-98x1
|
||||
jp.pc98.kbd:fr:Japonais PC-98x1
|
||||
jp.pc98.kbd:pt:Japonês PC-98x1
|
||||
jp.pc98.kbd:es:Japonés PC-98x1
|
||||
jp.pc98.kbd:uk:Японська PC-98x1
|
||||
|
||||
jp.pc98.iso.kbd:en:Japanese PC-98x1 (ISO)
|
||||
jp.pc98.iso.kbd:de:Japanisch PC-98x1 (ISO)
|
||||
jp.pc98.iso.kbd:fr:Japonais PC-98x1 (ISO)
|
||||
jp.pc98.iso.kbd:pt:Japonês PC-98x1 (ISO)
|
||||
jp.pc98.iso.kbd:es:Japonés PC-98x1 (ISO)
|
||||
jp.pc98.iso.kbd:uk:Японська PC-98x1 (ISO)
|
||||
|
||||
kz.kst.kbd:en:Kazakh
|
||||
kz.kst.kbd:de:Kasachisch
|
||||
kz.kst.kbd:fr:Kazakh
|
||||
|
@ -48,8 +48,6 @@ FILES= INDEX.keymaps \
|
||||
it.kbd \
|
||||
jp.capsctrl.kbd \
|
||||
jp.kbd \
|
||||
jp.pc98.iso.kbd \
|
||||
jp.pc98.kbd \
|
||||
kz.io.kbd \
|
||||
kz.kst.kbd \
|
||||
latinamerican.acc.kbd \
|
||||
|
@ -1,134 +0,0 @@
|
||||
# $FreeBSD$
|
||||
# alt
|
||||
# scan cntrl alt alt cntrl lock
|
||||
# code base shift cntrl shift alt shift cntrl shift state
|
||||
# ------------------------------------------------------------------
|
||||
000 esc esc esc esc esc esc debug esc O
|
||||
001 '1' '!' '!' '!' '1' '!' '!' '!' O
|
||||
002 '2' '@' sub sub '2' '"' nul nul O
|
||||
003 '3' '#' esc esc '3' '#' esc esc O
|
||||
004 '4' '$' fs fs '4' '$' fs fs O
|
||||
005 '5' '%' gs gs '5' '%' gs gs O
|
||||
006 '6' '^' rs rs '6' '&' rs rs O
|
||||
007 '7' '&' '&' '&' '7' ''' us us O
|
||||
008 '8' '*' bs bs '8' '(' del del O
|
||||
009 '9' '(' '(' '(' '9' ')' '9' '9' O
|
||||
010 '0' ')' ')' ')' '0' nop '0' '0' O
|
||||
011 '-' '_' us us '-' '=' '-' '-' O
|
||||
012 '=' '+' '+' '+' '^' '`' rs rs O
|
||||
013 0xa5 '|' fs fs 0xa5 '|' fs fs O
|
||||
014 bs bs bs bs bs bs bs bs O
|
||||
015 ht btab ht btab ht btab ht btab O
|
||||
016 'q' 'Q' dc1 dc1 'q' 'Q' dc1 dc1 C
|
||||
017 'w' 'W' etb etb 'w' 'W' etb etb C
|
||||
018 'e' 'E' enq enq 'e' 'E' enq enq C
|
||||
019 'r' 'R' dc2 dc2 'r' 'R' dc2 dc2 C
|
||||
020 't' 'T' dc4 dc4 't' 'T' dc4 dc4 C
|
||||
021 'y' 'Y' em em 'y' 'Y' em em C
|
||||
022 'u' 'U' nak nak 'u' 'U' nak nak C
|
||||
023 'i' 'I' ht ht 'i' 'I' ht ht C
|
||||
024 'o' 'O' si si 'o' 'O' si si C
|
||||
025 'p' 'P' dle dle 'p' 'P' dle dle C
|
||||
026 '[' '{' esc esc '@' '~' nul nul O
|
||||
027 ']' '}' gs gs '[' '{' esc esc O
|
||||
028 cr cr nl nl cr cr nl nl O
|
||||
029 'a' 'A' soh soh 'a' 'A' soh soh C
|
||||
030 's' 'S' dc3 dc3 's' 'S' dc3 dc3 C
|
||||
031 'd' 'D' eot eot 'd' 'D' eot eot C
|
||||
032 'f' 'F' ack ack 'f' 'F' ack ack C
|
||||
033 'g' 'G' bel bel 'g' 'G' bel bel C
|
||||
034 'h' 'H' bs bs 'h' 'H' bs bs C
|
||||
035 'j' 'J' nl nl 'j' 'J' nl nl C
|
||||
036 'k' 'K' vt vt 'k' 'K' vt vt C
|
||||
037 'l' 'L' ff ff 'l' 'L' ff ff C
|
||||
038 ';' ':' ';' ';' ';' '+' ';' ';' O
|
||||
039 ''' '"' ''' ''' ':' '*' ':' ':' O
|
||||
040 '`' '~' '~' '~' ']' '}' gs gs O
|
||||
041 'z' 'Z' sub sub 'z' 'Z' sub sub C
|
||||
042 'x' 'X' can can 'x' 'X' can can C
|
||||
043 'c' 'C' etx etx 'c' 'C' etx etx C
|
||||
044 'v' 'V' syn syn 'v' 'V' syn syn C
|
||||
045 'b' 'B' stx stx 'b' 'B' stx stx C
|
||||
046 'n' 'N' so so 'n' 'N' so so C
|
||||
047 'm' 'M' cr cr 'm' 'M' cr cr C
|
||||
048 ',' '<' '<' '<' ',' '<' '<' '<' O
|
||||
049 '.' '>' '>' '>' '.' '>' '>' '>' O
|
||||
050 '/' '?' del del '/' '?' del del O
|
||||
051 '\' '|' fs fs nop '_' us us O
|
||||
052 ' ' ' ' nul nul ' ' ' ' nul nul O
|
||||
053 esc esc esc esc esc esc esc esc O
|
||||
054 fkey59 fkey59 fkey59 fkey59 fkey59 fkey59 fkey59 fkey59 O
|
||||
055 fkey51 fkey51 fkey51 fkey51 fkey51 fkey51 fkey51 fkey51 O
|
||||
056 fkey60 fkey60 fkey60 fkey60 fkey60 fkey60 fkey60 fkey60 O
|
||||
057 del del del del del del boot boot N
|
||||
058 fkey50 fkey50 fkey50 fkey50 fkey50 fkey50 fkey50 fkey50 O
|
||||
059 fkey53 fkey53 fkey53 fkey53 fkey53 fkey53 fkey53 fkey53 O
|
||||
060 fkey55 fkey55 fkey55 fkey55 fkey55 fkey55 fkey55 fkey55 O
|
||||
061 fkey58 fkey58 fkey58 fkey58 fkey58 fkey58 fkey58 fkey58 O
|
||||
062 fkey49 fkey49 fkey49 fkey49 fkey49 fkey49 fkey49 fkey49 O
|
||||
063 fkey57 fkey57 fkey57 fkey57 fkey57 fkey57 fkey57 fkey57 O
|
||||
064 '-' '-' '-' '-' '-' '-' '-' '-' O
|
||||
065 '/' '/' '/' '/' '/' '/' '/' '/' O
|
||||
066 '7' '7' '7' '7' '7' '7' '7' '7' O
|
||||
067 '8' '8' '8' '8' '8' '8' '8' '8' O
|
||||
068 '9' '9' '9' '9' '9' '9' '9' '9' O
|
||||
069 '*' '*' '*' '*' '*' '*' '*' '*' O
|
||||
070 '4' '4' '4' '4' '4' '4' '4' '4' O
|
||||
071 '5' '5' '5' '5' '5' '5' '5' '5' O
|
||||
072 '6' '6' '6' '6' '6' '6' '6' '6' O
|
||||
073 '+' '+' '+' '+' '+' '+' '+' '+' O
|
||||
074 '1' '1' '1' '1' '1' '1' '1' '1' O
|
||||
075 '2' '2' '2' '2' '2' '2' '2' '2' O
|
||||
076 '3' '3' '3' '3' '3' '3' '3' '3' O
|
||||
077 '=' '=' '=' '=' '=' '=' '=' '=' O
|
||||
078 '0' '0' '0' '0' '0' '0' '0' '0' O
|
||||
079 ',' ',' ',' ',' ',' ',' ',' ',' O
|
||||
080 '.' '.' '.' '.' '.' '.' '.' '.' O
|
||||
081 meta meta meta meta meta meta meta meta O
|
||||
082 fkey11 fkey23 fkey35 fkey47 scr11 scr11 scr11 scr11 O
|
||||
083 fkey12 fkey24 fkey36 fkey48 scr12 scr12 scr12 scr12 O
|
||||
084 slock slock slock slock slock slock slock slock O
|
||||
085 nop nop nop nop nop nop nop nop O
|
||||
086 nop nop nop nop nop nop nop nop O
|
||||
087 nop nop nop nop nop nop nop nop O
|
||||
088 nop nop nop nop nop nop nop nop O
|
||||
089 nop nop nop nop nop nop nop nop O
|
||||
090 nop nop nop nop nop nop nop nop O
|
||||
091 nop nop nop nop nop nop nop nop O
|
||||
092 nop nop nop nop nop nop nop nop O
|
||||
093 nop nop nop nop nop nop nop nop O
|
||||
094 nop nop nop nop nop nop nop nop O
|
||||
095 nop nop nop nop nop nop nop nop O
|
||||
096 slock saver slock saver susp nop susp nop O
|
||||
097 nscr nscr debug debug nop nop nop nop O
|
||||
098 fkey01 fkey13 fkey25 fkey37 scr01 scr01 scr01 scr01 O
|
||||
099 fkey02 fkey14 fkey26 fkey38 scr02 scr02 scr02 scr02 O
|
||||
100 fkey03 fkey15 fkey27 fkey39 scr03 scr03 scr03 scr03 O
|
||||
101 fkey04 fkey16 fkey28 fkey40 scr04 scr04 scr04 scr04 O
|
||||
102 fkey05 fkey17 fkey29 fkey41 scr05 scr05 scr05 scr05 O
|
||||
103 fkey06 fkey18 fkey30 fkey42 scr06 scr06 scr06 scr06 O
|
||||
104 fkey07 fkey19 fkey31 fkey43 scr07 scr07 scr07 scr07 O
|
||||
105 fkey08 fkey20 fkey32 fkey44 scr08 scr08 scr08 scr08 O
|
||||
106 fkey09 fkey21 fkey33 fkey45 scr09 scr09 scr09 scr09 O
|
||||
107 fkey10 fkey22 fkey34 fkey46 scr10 scr10 scr10 scr10 O
|
||||
108 nop nop nop nop nop nop nop nop O
|
||||
109 nop nop nop nop nop nop nop nop O
|
||||
110 nop nop nop nop nop nop nop nop O
|
||||
111 nop nop nop nop nop nop nop nop O
|
||||
112 lshift lshift lshift lshift lshift lshift lshift lshift O
|
||||
113 clock clock clock clock clock clock clock clock O
|
||||
114 lalt lalt lalt lalt lalt lalt lalt lalt O
|
||||
115 lalt lalt lalt lalt lalt lalt lalt lalt O
|
||||
116 lctrl lctrl lctrl lctrl lctrl lctrl lctrl lctrl O
|
||||
117 nop nop nop nop nop nop nop nop O
|
||||
118 nop nop nop nop nop nop nop nop O
|
||||
119 nop nop nop nop nop nop nop nop O
|
||||
120 nop nop nop nop nop nop nop nop O
|
||||
121 nop nop nop nop nop nop nop nop O
|
||||
122 nop nop nop nop nop nop nop nop O
|
||||
123 nop nop nop nop nop nop nop nop O
|
||||
124 nop nop nop nop nop nop nop nop O
|
||||
125 nop nop nop nop nop nop nop nop O
|
||||
126 nop nop nop nop nop nop nop nop O
|
||||
127 nop nop nop nop nop nop nop nop O
|
||||
|
@ -1,134 +0,0 @@
|
||||
# $FreeBSD$
|
||||
# alt
|
||||
# scan cntrl alt alt cntrl lock
|
||||
# code base shift cntrl shift alt shift cntrl shift state
|
||||
# ------------------------------------------------------------------
|
||||
000 esc esc esc esc esc esc debug esc O
|
||||
001 '1' '!' '!' '!' '1' '!' '!' '!' O
|
||||
002 '2' '"' sub sub '2' '@' nul nul O
|
||||
003 '3' '#' esc esc '3' '#' esc esc O
|
||||
004 '4' '$' fs fs '4' '$' fs fs O
|
||||
005 '5' '%' gs gs '5' '%' gs gs O
|
||||
006 '6' '&' rs rs '6' '^' rs rs O
|
||||
007 '7' ''' us us '7' '&' '&' '&' O
|
||||
008 '8' '(' del del '8' '*' bs bs O
|
||||
009 '9' ')' '9' '9' '9' '(' '(' '(' O
|
||||
010 '0' nop '0' '0' '0' ')' ')' ')' O
|
||||
011 '-' '=' '-' '-' '-' '_' us us O
|
||||
012 '^' '`' rs rs '=' '+' '+' '+' O
|
||||
013 '\' '|' fs fs 0xa5 '|' fs fs O
|
||||
014 bs bs bs bs bs bs bs bs O
|
||||
015 ht btab ht btab ht btab ht btab O
|
||||
016 'q' 'Q' dc1 dc1 'q' 'Q' dc1 dc1 C
|
||||
017 'w' 'W' etb etb 'w' 'W' etb etb C
|
||||
018 'e' 'E' enq enq 'e' 'E' enq enq C
|
||||
019 'r' 'R' dc2 dc2 'r' 'R' dc2 dc2 C
|
||||
020 't' 'T' dc4 dc4 't' 'T' dc4 dc4 C
|
||||
021 'y' 'Y' em em 'y' 'Y' em em C
|
||||
022 'u' 'U' nak nak 'u' 'U' nak nak C
|
||||
023 'i' 'I' ht ht 'i' 'I' ht ht C
|
||||
024 'o' 'O' si si 'o' 'O' si si C
|
||||
025 'p' 'P' dle dle 'p' 'P' dle dle C
|
||||
026 '@' '~' nul nul '[' '{' esc esc O
|
||||
027 '[' '{' esc esc ']' '}' gs gs O
|
||||
028 cr cr nl nl cr cr nl nl O
|
||||
029 'a' 'A' soh soh 'a' 'A' soh soh C
|
||||
030 's' 'S' dc3 dc3 's' 'S' dc3 dc3 C
|
||||
031 'd' 'D' eot eot 'd' 'D' eot eot C
|
||||
032 'f' 'F' ack ack 'f' 'F' ack ack C
|
||||
033 'g' 'G' bel bel 'g' 'G' bel bel C
|
||||
034 'h' 'H' bs bs 'h' 'H' bs bs C
|
||||
035 'j' 'J' nl nl 'j' 'J' nl nl C
|
||||
036 'k' 'K' vt vt 'k' 'K' vt vt C
|
||||
037 'l' 'L' ff ff 'l' 'L' ff ff C
|
||||
038 ';' '+' ';' ';' ';' ':' ';' ';' O
|
||||
039 ':' '*' ':' ':' ''' '"' ''' ''' O
|
||||
040 ']' '}' gs gs '`' '~' '~' '~' O
|
||||
041 'z' 'Z' sub sub 'z' 'Z' sub sub C
|
||||
042 'x' 'X' can can 'x' 'X' can can C
|
||||
043 'c' 'C' etx etx 'c' 'C' etx etx C
|
||||
044 'v' 'V' syn syn 'v' 'V' syn syn C
|
||||
045 'b' 'B' stx stx 'b' 'B' stx stx C
|
||||
046 'n' 'N' so so 'n' 'N' so so C
|
||||
047 'm' 'M' cr cr 'm' 'M' cr cr C
|
||||
048 ',' '<' '<' '<' ',' '<' '<' '<' O
|
||||
049 '.' '>' '>' '>' '.' '>' '>' '>' O
|
||||
050 '/' '?' del del '/' '?' del del O
|
||||
051 nop '_' us us '\' '|' fs fs O
|
||||
052 ' ' ' ' nul nul ' ' ' ' nul nul O
|
||||
053 esc esc esc esc esc esc esc esc O
|
||||
054 fkey59 fkey59 fkey59 fkey59 fkey59 fkey59 fkey59 fkey59 O
|
||||
055 fkey51 fkey51 fkey51 fkey51 fkey51 fkey51 fkey51 fkey51 O
|
||||
056 fkey60 fkey60 fkey60 fkey60 fkey60 fkey60 fkey60 fkey60 O
|
||||
057 del del del del del del boot boot N
|
||||
058 fkey50 fkey50 fkey50 fkey50 fkey50 fkey50 fkey50 fkey50 O
|
||||
059 fkey53 fkey53 fkey53 fkey53 fkey53 fkey53 fkey53 fkey53 O
|
||||
060 fkey55 fkey55 fkey55 fkey55 fkey55 fkey55 fkey55 fkey55 O
|
||||
061 fkey58 fkey58 fkey58 fkey58 fkey58 fkey58 fkey58 fkey58 O
|
||||
062 fkey49 fkey49 fkey49 fkey49 fkey49 fkey49 fkey49 fkey49 O
|
||||
063 fkey57 fkey57 fkey57 fkey57 fkey57 fkey57 fkey57 fkey57 O
|
||||
064 '-' '-' '-' '-' '-' '-' '-' '-' O
|
||||
065 '/' '/' '/' '/' '/' '/' '/' '/' O
|
||||
066 '7' '7' '7' '7' '7' '7' '7' '7' O
|
||||
067 '8' '8' '8' '8' '8' '8' '8' '8' O
|
||||
068 '9' '9' '9' '9' '9' '9' '9' '9' O
|
||||
069 '*' '*' '*' '*' '*' '*' '*' '*' O
|
||||
070 '4' '4' '4' '4' '4' '4' '4' '4' O
|
||||
071 '5' '5' '5' '5' '5' '5' '5' '5' O
|
||||
072 '6' '6' '6' '6' '6' '6' '6' '6' O
|
||||
073 '+' '+' '+' '+' '+' '+' '+' '+' O
|
||||
074 '1' '1' '1' '1' '1' '1' '1' '1' O
|
||||
075 '2' '2' '2' '2' '2' '2' '2' '2' O
|
||||
076 '3' '3' '3' '3' '3' '3' '3' '3' O
|
||||
077 '=' '=' '=' '=' '=' '=' '=' '=' O
|
||||
078 '0' '0' '0' '0' '0' '0' '0' '0' O
|
||||
079 ',' ',' ',' ',' ',' ',' ',' ',' O
|
||||
080 '.' '.' '.' '.' '.' '.' '.' '.' O
|
||||
081 meta meta meta meta meta meta meta meta O
|
||||
082 fkey11 fkey23 fkey35 fkey47 scr11 scr11 scr11 scr11 O
|
||||
083 fkey12 fkey24 fkey36 fkey48 scr12 scr12 scr12 scr12 O
|
||||
084 slock slock slock slock slock slock slock slock O
|
||||
085 nop nop nop nop nop nop nop nop O
|
||||
086 nop nop nop nop nop nop nop nop O
|
||||
087 nop nop nop nop nop nop nop nop O
|
||||
088 nop nop nop nop nop nop nop nop O
|
||||
089 nop nop nop nop nop nop nop nop O
|
||||
090 nop nop nop nop nop nop nop nop O
|
||||
091 nop nop nop nop nop nop nop nop O
|
||||
092 nop nop nop nop nop nop nop nop O
|
||||
093 nop nop nop nop nop nop nop nop O
|
||||
094 nop nop nop nop nop nop nop nop O
|
||||
095 nop nop nop nop nop nop nop nop O
|
||||
096 slock saver slock saver susp nop susp nop O
|
||||
097 nscr nscr debug debug nop nop nop nop O
|
||||
098 fkey01 fkey13 fkey25 fkey37 scr01 scr01 scr01 scr01 O
|
||||
099 fkey02 fkey14 fkey26 fkey38 scr02 scr02 scr02 scr02 O
|
||||
100 fkey03 fkey15 fkey27 fkey39 scr03 scr03 scr03 scr03 O
|
||||
101 fkey04 fkey16 fkey28 fkey40 scr04 scr04 scr04 scr04 O
|
||||
102 fkey05 fkey17 fkey29 fkey41 scr05 scr05 scr05 scr05 O
|
||||
103 fkey06 fkey18 fkey30 fkey42 scr06 scr06 scr06 scr06 O
|
||||
104 fkey07 fkey19 fkey31 fkey43 scr07 scr07 scr07 scr07 O
|
||||
105 fkey08 fkey20 fkey32 fkey44 scr08 scr08 scr08 scr08 O
|
||||
106 fkey09 fkey21 fkey33 fkey45 scr09 scr09 scr09 scr09 O
|
||||
107 fkey10 fkey22 fkey34 fkey46 scr10 scr10 scr10 scr10 O
|
||||
108 nop nop nop nop nop nop nop nop O
|
||||
109 nop nop nop nop nop nop nop nop O
|
||||
110 nop nop nop nop nop nop nop nop O
|
||||
111 nop nop nop nop nop nop nop nop O
|
||||
112 lshift lshift lshift lshift lshift lshift lshift lshift O
|
||||
113 clock clock clock clock clock clock clock clock O
|
||||
114 lalt lalt lalt lalt lalt lalt lalt lalt O
|
||||
115 lalt lalt lalt lalt lalt lalt lalt lalt O
|
||||
116 lctrl lctrl lctrl lctrl lctrl lctrl lctrl lctrl O
|
||||
117 nop nop nop nop nop nop nop nop O
|
||||
118 nop nop nop nop nop nop nop nop O
|
||||
119 nop nop nop nop nop nop nop nop O
|
||||
120 nop nop nop nop nop nop nop nop O
|
||||
121 nop nop nop nop nop nop nop nop O
|
||||
122 nop nop nop nop nop nop nop nop O
|
||||
123 nop nop nop nop nop nop nop nop O
|
||||
124 nop nop nop nop nop nop nop nop O
|
||||
125 nop nop nop nop nop nop nop nop O
|
||||
126 nop nop nop nop nop nop nop nop O
|
||||
127 nop nop nop nop nop nop nop nop O
|
||||
|
@ -8,7 +8,7 @@ CSCOPEDIRS= boot bsm cam cddl compat conf contrib crypto ddb dev fs gdb \
|
||||
rpc security sys ufs vm xdr xen ${CSCOPE_ARCHDIR}
|
||||
.if !defined(CSCOPE_ARCHDIR)
|
||||
.if defined(ALL_ARCH)
|
||||
CSCOPE_ARCHDIR = amd64 arm arm64 i386 mips pc98 powerpc riscv sparc64 x86
|
||||
CSCOPE_ARCHDIR = amd64 arm arm64 i386 mips powerpc riscv sparc64 x86
|
||||
.else
|
||||
CSCOPE_ARCHDIR = ${MACHINE}
|
||||
.if ${MACHINE} != ${MACHINE_CPUARCH}
|
||||
|
@ -1040,7 +1040,12 @@ pmap_bootstrap(vm_paddr_t *firstaddr)
|
||||
|
||||
virtual_avail = va;
|
||||
|
||||
/* Initialize the PAT MSR. */
|
||||
/*
|
||||
* Initialize the PAT MSR.
|
||||
* pmap_init_pat() clears and sets CR4_PGE, which, as a
|
||||
* side-effect, invalidates stale PG_G TLB entries that might
|
||||
* have been created in our pre-boot environment.
|
||||
*/
|
||||
pmap_init_pat();
|
||||
|
||||
/* Initialize TLB Context Id. */
|
||||
@ -3428,6 +3433,7 @@ pmap_demote_pde_locked(pmap_t pmap, pd_entry_t *pde, vm_offset_t va,
|
||||
vm_paddr_t mptepa;
|
||||
vm_page_t mpte;
|
||||
struct spglist free;
|
||||
vm_offset_t sva;
|
||||
int PG_PTE_CACHE;
|
||||
|
||||
PG_G = pmap_global_bit(pmap);
|
||||
@ -3464,9 +3470,9 @@ pmap_demote_pde_locked(pmap_t pmap, pd_entry_t *pde, vm_offset_t va,
|
||||
DMAP_MAX_ADDRESS ? VM_ALLOC_INTERRUPT : VM_ALLOC_NORMAL) |
|
||||
VM_ALLOC_NOOBJ | VM_ALLOC_WIRED)) == NULL) {
|
||||
SLIST_INIT(&free);
|
||||
pmap_remove_pde(pmap, pde, trunc_2mpage(va), &free,
|
||||
lockp);
|
||||
pmap_invalidate_page(pmap, trunc_2mpage(va));
|
||||
sva = trunc_2mpage(va);
|
||||
pmap_remove_pde(pmap, pde, sva, &free, lockp);
|
||||
pmap_invalidate_range(pmap, sva, sva + NBPDR - 1);
|
||||
pmap_free_zero_pages(&free);
|
||||
CTR2(KTR_PMAP, "pmap_demote_pde: failure for va %#lx"
|
||||
" in pmap %p", va, pmap);
|
||||
@ -3608,11 +3614,23 @@ pmap_remove_pde(pmap_t pmap, pd_entry_t *pdq, vm_offset_t sva,
|
||||
pmap->pm_stats.wired_count -= NBPDR / PAGE_SIZE;
|
||||
|
||||
/*
|
||||
* Machines that don't support invlpg, also don't support
|
||||
* PG_G.
|
||||
* When workaround_erratum383 is false, a promotion to a 2M
|
||||
* page mapping does not invalidate the 512 4K page mappings
|
||||
* from the TLB. Consequently, at this point, the TLB may
|
||||
* hold both 4K and 2M page mappings. Therefore, the entire
|
||||
* range of addresses must be invalidated here. In contrast,
|
||||
* when workaround_erratum383 is true, a promotion does
|
||||
* invalidate the 512 4K page mappings, and so a single INVLPG
|
||||
* suffices to invalidate the 2M page mapping.
|
||||
*/
|
||||
if (oldpde & PG_G)
|
||||
pmap_invalidate_page(kernel_pmap, sva);
|
||||
if ((oldpde & PG_G) != 0) {
|
||||
if (workaround_erratum383)
|
||||
pmap_invalidate_page(kernel_pmap, sva);
|
||||
else
|
||||
pmap_invalidate_range(kernel_pmap, sva,
|
||||
sva + NBPDR - 1);
|
||||
}
|
||||
|
||||
pmap_resident_count_dec(pmap, NBPDR / PAGE_SIZE);
|
||||
if (oldpde & PG_MANAGED) {
|
||||
CHANGE_PV_LIST_LOCK_TO_PHYS(lockp, oldpde & PG_PS_FRAME);
|
||||
@ -3994,9 +4012,14 @@ pmap_protect_pde(pmap_t pmap, pd_entry_t *pde, vm_offset_t sva, vm_prot_t prot)
|
||||
if (newpde != oldpde) {
|
||||
if (!atomic_cmpset_long(pde, oldpde, newpde))
|
||||
goto retry;
|
||||
if (oldpde & PG_G)
|
||||
pmap_invalidate_page(pmap, sva);
|
||||
else
|
||||
if (oldpde & PG_G) {
|
||||
/* See pmap_remove_pde() for explanation. */
|
||||
if (workaround_erratum383)
|
||||
pmap_invalidate_page(kernel_pmap, sva);
|
||||
else
|
||||
pmap_invalidate_range(kernel_pmap, sva,
|
||||
sva + NBPDR - 1);
|
||||
} else
|
||||
anychanged = TRUE;
|
||||
}
|
||||
return (anychanged);
|
||||
|
@ -112,6 +112,43 @@ atomic_clear_64(volatile uint64_t *address, uint64_t clearmask)
|
||||
__with_interrupts_disabled(*address &= ~clearmask);
|
||||
}
|
||||
|
||||
static __inline int
|
||||
atomic_fcmpset_32(volatile u_int32_t *p, volatile u_int32_t *cmpval, volatile u_int32_t newval)
|
||||
{
|
||||
u_int32_t ret;
|
||||
|
||||
__with_interrupts_disabled(
|
||||
{
|
||||
ret = *p;
|
||||
if (*p == *cmpval) {
|
||||
*p = newval;
|
||||
ret = 1;
|
||||
} else {
|
||||
*cmpval = *p;
|
||||
ret = 0;
|
||||
}
|
||||
});
|
||||
return (ret);
|
||||
}
|
||||
|
||||
static __inline int
|
||||
atomic_fcmpset_64(volatile u_int64_t *p, volatile u_int64_t *cmpval, volatile u_int64_t newval)
|
||||
{
|
||||
u_int64_t ret;
|
||||
|
||||
__with_interrupts_disabled(
|
||||
{
|
||||
if (*p == *cmpval) {
|
||||
*p = newval;
|
||||
ret = 1;
|
||||
} else {
|
||||
*cmpval = *p;
|
||||
ret = 0;
|
||||
}
|
||||
});
|
||||
return (ret);
|
||||
}
|
||||
|
||||
static __inline u_int32_t
|
||||
atomic_cmpset_32(volatile u_int32_t *p, volatile u_int32_t cmpval, volatile u_int32_t newval)
|
||||
{
|
||||
@ -370,6 +407,12 @@ atomic_swap_32(volatile u_int32_t *p, u_int32_t v)
|
||||
return (__swp(v, p));
|
||||
}
|
||||
|
||||
#define atomic_fcmpset_rel_32 atomic_fcmpset_32
|
||||
#define atomic_fcmpset_acq_32 atomic_fcmpset_32
|
||||
#define atomic_fcmpset_rel_64 atomic_fcmpset_64
|
||||
#define atomic_fcmpset_acq_64 atomic_fcmpset_64
|
||||
#define atomic_fcmpset_acq_long atomic_fcmpset_long
|
||||
#define atomic_fcmpset_rel_long atomic_fcmpset_long
|
||||
#define atomic_cmpset_rel_32 atomic_cmpset_32
|
||||
#define atomic_cmpset_acq_32 atomic_cmpset_32
|
||||
#define atomic_cmpset_rel_64 atomic_cmpset_64
|
||||
@ -420,6 +463,14 @@ atomic_cmpset_long(volatile u_long *dst, u_long old, u_long newe)
|
||||
return (atomic_cmpset_32((volatile uint32_t *)dst, old, newe));
|
||||
}
|
||||
|
||||
static __inline u_long
|
||||
atomic_fcmpset_long(volatile u_long *dst, u_long *old, u_long newe)
|
||||
{
|
||||
|
||||
return (atomic_fcmpset_32((volatile uint32_t *)dst,
|
||||
(uint32_t *)old, newe));
|
||||
}
|
||||
|
||||
static __inline u_long
|
||||
atomic_fetchadd_long(volatile u_long *p, u_long v)
|
||||
{
|
||||
|
@ -190,6 +190,114 @@ ATOMIC_ACQ_REL(clear, 32)
|
||||
ATOMIC_ACQ_REL(clear, 64)
|
||||
ATOMIC_ACQ_REL_LONG(clear)
|
||||
|
||||
static __inline int
|
||||
atomic_fcmpset_32(volatile uint32_t *p, uint32_t *cmpval, uint32_t newval)
|
||||
{
|
||||
uint32_t tmp;
|
||||
uint32_t _cmpval = *cmpval;
|
||||
int ret;
|
||||
|
||||
__asm __volatile(
|
||||
" mov %0, #1 \n"
|
||||
" ldrex %1, [%2] \n"
|
||||
" cmp %1, %3 \n"
|
||||
" it eq \n"
|
||||
" strexeq %0, %4, [%2] \n"
|
||||
: "=&r" (ret), "=&r" (tmp), "+r" (p), "+r" (_cmpval), "+r" (newval)
|
||||
: : "cc", "memory");
|
||||
*cmpval = tmp;
|
||||
return (!ret);
|
||||
}
|
||||
|
||||
static __inline uint64_t
|
||||
atomic_fcmpset_64(volatile uint64_t *p, uint64_t *cmpval, uint64_t newval)
|
||||
{
|
||||
uint64_t tmp;
|
||||
uint64_t _cmpval = *cmpval;
|
||||
int ret;
|
||||
|
||||
__asm __volatile(
|
||||
"1: mov %[ret], #1 \n"
|
||||
" ldrexd %Q[tmp], %R[tmp], [%[ptr]] \n"
|
||||
" teq %Q[tmp], %Q[_cmpval] \n"
|
||||
" ite eq \n"
|
||||
" teqeq %R[tmp], %R[_cmpval] \n"
|
||||
" bne 2f \n"
|
||||
" strexd %[ret], %Q[newval], %R[newval], [%[ptr]]\n"
|
||||
"2: \n"
|
||||
: [ret] "=&r" (ret),
|
||||
[tmp] "=&r" (tmp)
|
||||
: [ptr] "r" (p),
|
||||
[_cmpval] "r" (_cmpval),
|
||||
[newval] "r" (newval)
|
||||
: "cc", "memory");
|
||||
*cmpval = tmp;
|
||||
return (!ret);
|
||||
}
|
||||
|
||||
static __inline u_long
|
||||
atomic_fcmpset_long(volatile u_long *p, u_long *cmpval, u_long newval)
|
||||
{
|
||||
|
||||
return (atomic_fcmpset_32((volatile uint32_t *)p,
|
||||
(uint32_t *)cmpval, newval));
|
||||
}
|
||||
|
||||
static __inline uint64_t
|
||||
atomic_fcmpset_acq_64(volatile uint64_t *p, uint64_t *cmpval, uint64_t newval)
|
||||
{
|
||||
uint64_t ret;
|
||||
|
||||
ret = atomic_fcmpset_64(p, cmpval, newval);
|
||||
dmb();
|
||||
return (ret);
|
||||
}
|
||||
|
||||
static __inline u_long
|
||||
atomic_fcmpset_acq_long(volatile u_long *p, u_long *cmpval, u_long newval)
|
||||
{
|
||||
u_long ret;
|
||||
|
||||
ret = atomic_fcmpset_long(p, cmpval, newval);
|
||||
dmb();
|
||||
return (ret);
|
||||
}
|
||||
|
||||
static __inline uint32_t
|
||||
atomic_fcmpset_acq_32(volatile uint32_t *p, uint32_t *cmpval, uint32_t newval)
|
||||
{
|
||||
|
||||
uint32_t ret;
|
||||
|
||||
ret = atomic_fcmpset_32(p, cmpval, newval);
|
||||
dmb();
|
||||
return (ret);
|
||||
}
|
||||
|
||||
static __inline uint32_t
|
||||
atomic_fcmpset_rel_32(volatile uint32_t *p, uint32_t *cmpval, uint32_t newval)
|
||||
{
|
||||
|
||||
dmb();
|
||||
return (atomic_fcmpset_32(p, cmpval, newval));
|
||||
}
|
||||
|
||||
static __inline uint64_t
|
||||
atomic_fcmpset_rel_64(volatile uint64_t *p, uint64_t *cmpval, uint64_t newval)
|
||||
{
|
||||
|
||||
dmb();
|
||||
return (atomic_fcmpset_64(p, cmpval, newval));
|
||||
}
|
||||
|
||||
static __inline u_long
|
||||
atomic_fcmpset_rel_long(volatile u_long *p, u_long *cmpval, u_long newval)
|
||||
{
|
||||
|
||||
dmb();
|
||||
return (atomic_fcmpset_long(p, cmpval, newval));
|
||||
}
|
||||
|
||||
static __inline uint32_t
|
||||
atomic_cmpset_32(volatile uint32_t *p, uint32_t cmpval, uint32_t newval)
|
||||
{
|
||||
|
@ -84,6 +84,9 @@ atomic_store_long(volatile u_long *dst, u_long src)
|
||||
#define atomic_set_ptr atomic_set_32
|
||||
#define atomic_set_acq_ptr atomic_set_acq_32
|
||||
#define atomic_set_rel_ptr atomic_set_rel_32
|
||||
#define atomic_fcmpset_ptr atomic_fcmpset_32
|
||||
#define atomic_fcmpset_rel_ptr atomic_fcmpset_rel_32
|
||||
#define atomic_fcmpset_acq_ptr atomic_fcmpset_acq_32
|
||||
#define atomic_cmpset_ptr atomic_cmpset_32
|
||||
#define atomic_cmpset_acq_ptr atomic_cmpset_acq_32
|
||||
#define atomic_cmpset_rel_ptr atomic_cmpset_rel_32
|
||||
@ -105,6 +108,9 @@ atomic_store_long(volatile u_long *dst, u_long src)
|
||||
#define atomic_set_int atomic_set_32
|
||||
#define atomic_set_acq_int atomic_set_acq_32
|
||||
#define atomic_set_rel_int atomic_set_rel_32
|
||||
#define atomic_fcmpset_int atomic_fcmpset_32
|
||||
#define atomic_fcmpset_acq_int atomic_fcmpset_acq_32
|
||||
#define atomic_fcmpset_rel_int atomic_fcmpset_rel_32
|
||||
#define atomic_cmpset_int atomic_cmpset_32
|
||||
#define atomic_cmpset_acq_int atomic_cmpset_acq_32
|
||||
#define atomic_cmpset_rel_int atomic_cmpset_rel_32
|
||||
|
@ -98,6 +98,61 @@ ATOMIC(clear, bic)
|
||||
ATOMIC(set, orr)
|
||||
ATOMIC(subtract, sub)
|
||||
|
||||
#define ATOMIC_FCMPSET(bar, a, l) \
|
||||
static __inline int \
|
||||
atomic_fcmpset_##bar##32(volatile uint32_t *p, uint32_t *cmpval, \
|
||||
uint32_t newval) \
|
||||
{ \
|
||||
uint32_t tmp; \
|
||||
uint32_t _cmpval = *cmpval; \
|
||||
int res; \
|
||||
\
|
||||
__asm __volatile( \
|
||||
"1: mov %w1, #1 \n" \
|
||||
" ld"#a"xr %w0, [%2] \n" \
|
||||
" cmp %w0, %w3 \n" \
|
||||
" b.ne 2f \n" \
|
||||
" st"#l"xr %w1, %w4, [%2] \n" \
|
||||
"2:" \
|
||||
: "=&r"(tmp), "=&r"(res) \
|
||||
: "r" (p), "r" (_cmpval), "r" (newval) \
|
||||
: "cc", "memory" \
|
||||
); \
|
||||
*cmpval = tmp; \
|
||||
\
|
||||
return (!res); \
|
||||
} \
|
||||
\
|
||||
static __inline int \
|
||||
atomic_fcmpset_##bar##64(volatile uint64_t *p, uint64_t *cmpval, \
|
||||
uint64_t newval) \
|
||||
{ \
|
||||
uint64_t tmp; \
|
||||
uint64_t _cmpval = *cmpval; \
|
||||
int res; \
|
||||
\
|
||||
__asm __volatile( \
|
||||
"1: mov %w1, #1 \n" \
|
||||
" ld"#a"xr %0, [%2] \n" \
|
||||
" cmp %0, %3 \n" \
|
||||
" b.ne 2f \n" \
|
||||
" st"#l"xr %w1, %4, [%2] \n" \
|
||||
"2:" \
|
||||
: "=&r"(tmp), "=&r"(res) \
|
||||
: "r" (p), "r" (_cmpval), "r" (newval) \
|
||||
: "cc", "memory" \
|
||||
); \
|
||||
*cmpval = tmp; \
|
||||
\
|
||||
return (!res); \
|
||||
}
|
||||
|
||||
ATOMIC_FCMPSET( , , )
|
||||
ATOMIC_FCMPSET(acq_, a, )
|
||||
ATOMIC_FCMPSET(rel_, ,l)
|
||||
|
||||
#undef ATOMIC_FCMPSET
|
||||
|
||||
#define ATOMIC_CMPSET(bar, a, l) \
|
||||
static __inline int \
|
||||
atomic_cmpset_##bar##32(volatile uint32_t *p, uint32_t cmpval, \
|
||||
@ -311,6 +366,7 @@ atomic_store_rel_64(volatile uint64_t *p, uint64_t val)
|
||||
|
||||
|
||||
#define atomic_add_int atomic_add_32
|
||||
#define atomic_fcmpset_int atomic_fcmpset_32
|
||||
#define atomic_clear_int atomic_clear_32
|
||||
#define atomic_cmpset_int atomic_cmpset_32
|
||||
#define atomic_fetchadd_int atomic_fetchadd_32
|
||||
@ -320,6 +376,7 @@ atomic_store_rel_64(volatile uint64_t *p, uint64_t val)
|
||||
#define atomic_subtract_int atomic_subtract_32
|
||||
|
||||
#define atomic_add_acq_int atomic_add_acq_32
|
||||
#define atomic_fcmpset_acq_int atomic_fcmpset_acq_32
|
||||
#define atomic_clear_acq_int atomic_clear_acq_32
|
||||
#define atomic_cmpset_acq_int atomic_cmpset_acq_32
|
||||
#define atomic_load_acq_int atomic_load_acq_32
|
||||
@ -327,6 +384,7 @@ atomic_store_rel_64(volatile uint64_t *p, uint64_t val)
|
||||
#define atomic_subtract_acq_int atomic_subtract_acq_32
|
||||
|
||||
#define atomic_add_rel_int atomic_add_rel_32
|
||||
#define atomic_fcmpset_rel_int atomic_fcmpset_rel_32
|
||||
#define atomic_clear_rel_int atomic_add_rel_32
|
||||
#define atomic_cmpset_rel_int atomic_cmpset_rel_32
|
||||
#define atomic_set_rel_int atomic_set_rel_32
|
||||
@ -334,6 +392,7 @@ atomic_store_rel_64(volatile uint64_t *p, uint64_t val)
|
||||
#define atomic_store_rel_int atomic_store_rel_32
|
||||
|
||||
#define atomic_add_long atomic_add_64
|
||||
#define atomic_fcmpset_long atomic_fcmpset_64
|
||||
#define atomic_clear_long atomic_clear_64
|
||||
#define atomic_cmpset_long atomic_cmpset_64
|
||||
#define atomic_fetchadd_long atomic_fetchadd_64
|
||||
@ -343,6 +402,7 @@ atomic_store_rel_64(volatile uint64_t *p, uint64_t val)
|
||||
#define atomic_subtract_long atomic_subtract_64
|
||||
|
||||
#define atomic_add_ptr atomic_add_64
|
||||
#define atomic_fcmpset_ptr atomic_fcmpset_64
|
||||
#define atomic_clear_ptr atomic_clear_64
|
||||
#define atomic_cmpset_ptr atomic_cmpset_64
|
||||
#define atomic_fetchadd_ptr atomic_fetchadd_64
|
||||
@ -352,6 +412,7 @@ atomic_store_rel_64(volatile uint64_t *p, uint64_t val)
|
||||
#define atomic_subtract_ptr atomic_subtract_64
|
||||
|
||||
#define atomic_add_acq_long atomic_add_acq_64
|
||||
#define atomic_fcmpset_acq_long atomic_fcmpset_acq_64
|
||||
#define atomic_clear_acq_long atomic_add_acq_64
|
||||
#define atomic_cmpset_acq_long atomic_cmpset_acq_64
|
||||
#define atomic_load_acq_long atomic_load_acq_64
|
||||
@ -359,6 +420,7 @@ atomic_store_rel_64(volatile uint64_t *p, uint64_t val)
|
||||
#define atomic_subtract_acq_long atomic_subtract_acq_64
|
||||
|
||||
#define atomic_add_acq_ptr atomic_add_acq_64
|
||||
#define atomic_fcmpset_acq_ptr atomic_fcmpset_acq_64
|
||||
#define atomic_clear_acq_ptr atomic_add_acq_64
|
||||
#define atomic_cmpset_acq_ptr atomic_cmpset_acq_64
|
||||
#define atomic_load_acq_ptr atomic_load_acq_64
|
||||
@ -366,6 +428,7 @@ atomic_store_rel_64(volatile uint64_t *p, uint64_t val)
|
||||
#define atomic_subtract_acq_ptr atomic_subtract_acq_64
|
||||
|
||||
#define atomic_add_rel_long atomic_add_rel_64
|
||||
#define atomic_fcmpset_rel_long atomic_fcmpset_rel_64
|
||||
#define atomic_clear_rel_long atomic_clear_rel_64
|
||||
#define atomic_cmpset_rel_long atomic_cmpset_rel_64
|
||||
#define atomic_set_rel_long atomic_set_rel_64
|
||||
@ -373,6 +436,7 @@ atomic_store_rel_64(volatile uint64_t *p, uint64_t val)
|
||||
#define atomic_store_rel_long atomic_store_rel_64
|
||||
|
||||
#define atomic_add_rel_ptr atomic_add_rel_64
|
||||
#define atomic_fcmpset_rel_ptr atomic_fcmpset_rel_64
|
||||
#define atomic_clear_rel_ptr atomic_clear_rel_64
|
||||
#define atomic_cmpset_rel_ptr atomic_cmpset_rel_64
|
||||
#define atomic_set_rel_ptr atomic_set_rel_64
|
||||
|
@ -1,3 +0,0 @@
|
||||
# $FreeBSD$
|
||||
|
||||
SUBDIR+= libstand32
|
@ -7,8 +7,6 @@ SRCS+= module.c panic.c
|
||||
.if ${MACHINE} == "i386" || ${MACHINE_CPUARCH} == "amd64"
|
||||
SRCS+= load_elf32.c load_elf32_obj.c reloc_elf32.c
|
||||
SRCS+= load_elf64.c load_elf64_obj.c reloc_elf64.c
|
||||
.elif ${MACHINE} == "pc98"
|
||||
SRCS+= load_elf32.c load_elf32_obj.c reloc_elf32.c
|
||||
.elif ${MACHINE_CPUARCH} == "aarch64"
|
||||
SRCS+= load_elf64.c reloc_elf64.c
|
||||
.elif ${MACHINE_CPUARCH} == "arm"
|
||||
|
@ -45,15 +45,9 @@
|
||||
|
||||
/* Static ports to access PnP state machine */
|
||||
#ifndef _KERNEL
|
||||
#ifdef PC98
|
||||
/* pnp.h is included from pnpinfo.c. */
|
||||
#define _PNP_ADDRESS 0x259
|
||||
#define _PNP_WRITE_DATA 0xa59
|
||||
#else
|
||||
#define _PNP_ADDRESS 0x279
|
||||
#define _PNP_WRITE_DATA 0xa79
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* PnP Registers. Write to ADDRESS and then use WRITE/READ_DATA */
|
||||
#define SET_RD_DATA 0x00
|
||||
|
@ -827,9 +827,7 @@ void ficlCompilePlatform(FICL_SYSTEM *pSys)
|
||||
SET_FOREACH(fnpp, Xficl_compile_set)
|
||||
(*fnpp)(pSys);
|
||||
|
||||
#if defined(PC98)
|
||||
ficlSetEnv(pSys, "arch-pc98", FICL_TRUE);
|
||||
#elif defined(__i386__)
|
||||
#if defined(__i386__)
|
||||
ficlSetEnv(pSys, "arch-i386", FICL_TRUE);
|
||||
ficlSetEnv(pSys, "arch-powerpc", FICL_FALSE);
|
||||
#elif defined(__powerpc__)
|
||||
|
@ -46,49 +46,26 @@ variable fill
|
||||
124 constant ascii_pipe
|
||||
43 constant ascii_plus
|
||||
|
||||
s" arch-pc98" environment? [if]
|
||||
\ Single frames
|
||||
149 constant sh_el
|
||||
150 constant sv_el
|
||||
152 constant slt_el
|
||||
154 constant slb_el
|
||||
153 constant srt_el
|
||||
155 constant srb_el
|
||||
\ Double frames
|
||||
149 constant dh_el
|
||||
150 constant dv_el
|
||||
152 constant dlt_el
|
||||
154 constant dlb_el
|
||||
153 constant drt_el
|
||||
155 constant drb_el
|
||||
\ Fillings
|
||||
0 constant fill_none
|
||||
32 constant fill_blank
|
||||
135 constant fill_dark
|
||||
135 constant fill_med
|
||||
135 constant fill_bright
|
||||
[else]
|
||||
\ Single frames
|
||||
196 constant sh_el
|
||||
179 constant sv_el
|
||||
218 constant slt_el
|
||||
192 constant slb_el
|
||||
191 constant srt_el
|
||||
217 constant srb_el
|
||||
\ Double frames
|
||||
205 constant dh_el
|
||||
186 constant dv_el
|
||||
201 constant dlt_el
|
||||
200 constant dlb_el
|
||||
187 constant drt_el
|
||||
188 constant drb_el
|
||||
\ Fillings
|
||||
0 constant fill_none
|
||||
32 constant fill_blank
|
||||
176 constant fill_dark
|
||||
177 constant fill_med
|
||||
178 constant fill_bright
|
||||
[then]
|
||||
\ Single frames
|
||||
196 constant sh_el
|
||||
179 constant sv_el
|
||||
218 constant slt_el
|
||||
192 constant slb_el
|
||||
191 constant srt_el
|
||||
217 constant srb_el
|
||||
\ Double frames
|
||||
205 constant dh_el
|
||||
186 constant dv_el
|
||||
201 constant dlt_el
|
||||
200 constant dlb_el
|
||||
187 constant drt_el
|
||||
188 constant drb_el
|
||||
\ Fillings
|
||||
0 constant fill_none
|
||||
32 constant fill_blank
|
||||
176 constant fill_dark
|
||||
177 constant fill_med
|
||||
178 constant fill_bright
|
||||
|
||||
only forth definitions also frame-drawing
|
||||
|
||||
|
@ -52,7 +52,7 @@ CFLAGS= -ffreestanding \
|
||||
-I${.CURDIR}/../../../.. \
|
||||
-D_KERNEL \
|
||||
-Wall \
|
||||
-G0 -Xassembler -G0 \
|
||||
-G0 \
|
||||
-fno-pic -mno-abicalls \
|
||||
-msoft-float \
|
||||
-g
|
||||
|
@ -1,5 +0,0 @@
|
||||
# $FreeBSD$
|
||||
|
||||
SUBDIR= boot0 boot0.5 pc98boot btx boot2 cdboot kgzldr libpc98 loader
|
||||
|
||||
.include <bsd.subdir.mk>
|
@ -1,29 +0,0 @@
|
||||
# Common defines for all of /sys/boot/pc98/
|
||||
#
|
||||
# $FreeBSD$
|
||||
|
||||
BINDIR?= /boot
|
||||
|
||||
LOADER_ADDRESS?=0x200000
|
||||
CFLAGS+= -march=i386 -ffreestanding
|
||||
CFLAGS.gcc+= -mpreferred-stack-boundary=2
|
||||
CFLAGS+= ${CFLAGS_NO_SIMD} -msoft-float
|
||||
CFLAGS+= -Os -DPC98
|
||||
LDFLAGS+= -nostdlib
|
||||
|
||||
# BTX components
|
||||
.if exists(${.OBJDIR}/../btx)
|
||||
BTXDIR= ${.OBJDIR}/../btx
|
||||
.else
|
||||
BTXDIR= ${.CURDIR}/../btx
|
||||
.endif
|
||||
BTXLDR= ${BTXDIR}/btxldr/btxldr
|
||||
BTXKERN= ${BTXDIR}/btx/btx
|
||||
BTXCRT= ${BTXDIR}/lib/crt0.o
|
||||
|
||||
# compact binary with no padding between text, data, bss
|
||||
LDSCRIPT= ${SRCTOP}/sys/boot/i386/boot.ldscript
|
||||
LDFLAGS_BIN=-e start -Ttext ${ORG} -Wl,-T,${LDSCRIPT},-S,--oformat,binary
|
||||
LD_FLAGS_BIN=-static -T ${LDSCRIPT} --gc-sections
|
||||
|
||||
.include "../Makefile.inc"
|
@ -1,26 +0,0 @@
|
||||
# $FreeBSD$
|
||||
|
||||
PROG= ${BOOT}.out
|
||||
INTERNALPROG=
|
||||
FILES= ${BOOT}
|
||||
MAN=
|
||||
SRCS= start.s boot.s boot0.5.s disk.s selector.s support.s syscons.s \
|
||||
putssjis.s
|
||||
CLEANFILES= ${BOOT} ${BOOT}.bin
|
||||
|
||||
BOOT= boot0.5
|
||||
|
||||
# The base address that we the boot0 code to to run it. Don't change this
|
||||
# unless you are glutton for punishment.
|
||||
BOOT_BOOT0_ORG?= 0x0000
|
||||
|
||||
LDFLAGS=-e start -Ttext ${BOOT_BOOT0_ORG} -Wl,-N,-T,${.CURDIR}/ldscript
|
||||
|
||||
# The size of boot0.5 must be 7168 bytes
|
||||
${BOOT}: ${BOOT}.bin
|
||||
cat ${BOOT}.bin /dev/zero | ${DD} of=${BOOT} bs=1 count=7168
|
||||
|
||||
${BOOT}.bin: ${BOOT}.out
|
||||
${OBJCOPY} -S -O binary ${BOOT}.out ${.TARGET}
|
||||
|
||||
.include <bsd.prog.mk>
|
@ -1,174 +0,0 @@
|
||||
# Copyright (c) KATO Takenori, 1999, 2000.
|
||||
#
|
||||
# All rights reserved. Unpublished rights reserved under the copyright
|
||||
# laws of Japan.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions
|
||||
# are met:
|
||||
#
|
||||
# 1. Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer as
|
||||
# the first lines of this file unmodified.
|
||||
# 2. Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
||||
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
# $FreeBSD$
|
||||
#
|
||||
|
||||
.code16
|
||||
|
||||
.text
|
||||
.global boot
|
||||
#
|
||||
# Read bootstrap program and jump to it.
|
||||
#
|
||||
boot:
|
||||
# Step 1: Save parameters
|
||||
movw curdevice, %si
|
||||
movb daua(%si), %al
|
||||
movb %al, b_daua
|
||||
shlw %si
|
||||
movw secsize(%si), %ax
|
||||
movw %ax, b_secsize
|
||||
|
||||
movw curpartition, %si
|
||||
movb partnum(%si), %al # %al = real partition number
|
||||
xorb %ah, %ah
|
||||
movw %ax, b_partn # save real parttion number
|
||||
movb $5, %cl
|
||||
shlw %cl, %si # %si = offset to parttable
|
||||
addw $4, %si
|
||||
movb parttable(%si), %al # IPLS
|
||||
movb %al, b_sector
|
||||
incw %si
|
||||
movb parttable(%si), %al # IPLH
|
||||
movb %al, b_head
|
||||
incw %si # IPLC
|
||||
movw parttable(%si), %ax
|
||||
movw %ax, b_cylinder
|
||||
|
||||
# Step 2: Calculate the segment address of the bootstrap routine
|
||||
movw $0x1d00, %ax
|
||||
movw b_secsize, %cx
|
||||
shrw %cx
|
||||
shrw %cx
|
||||
subw %cx, %ax
|
||||
subw $0x100, %ax
|
||||
movw %ax, b_bootseg
|
||||
|
||||
# Step 3: Read bootstrap code
|
||||
movb $6, %ah
|
||||
movb b_daua, %al
|
||||
movw b_secsize, %bx
|
||||
shlw %bx # 2 sectors
|
||||
movw b_cylinder, %cx
|
||||
movb b_head, %dh
|
||||
movb b_sector, %dl
|
||||
movw b_bootseg, %es
|
||||
xorw %bp, %bp
|
||||
int $0x1b
|
||||
jc boot_error
|
||||
|
||||
# Step 4: Set DA/UA into BIOS work area
|
||||
xorw %ax, %ax
|
||||
movw %ax, %es
|
||||
movw $0x584, %bx # DISK_BOOT
|
||||
movb b_daua, %dl
|
||||
call write_biosparam
|
||||
|
||||
call sc_clean
|
||||
# Step 5: Set registers
|
||||
# %ah: 00
|
||||
# %al: DA/UA
|
||||
# %bx: Sector size * 2
|
||||
# %cx: cylinder number of boot partition
|
||||
# %si: pointer to partition table
|
||||
movw b_partn, %ax
|
||||
movb $5, %cl
|
||||
shl %cl, %ax # %ax = partition number * 32
|
||||
addw b_secsize, %ax
|
||||
movw %ax, %si # %si = pointer to partition table
|
||||
movw b_cylinder, %cx # %cx = cylinder
|
||||
movb b_head, %dh # %dh = head
|
||||
movb b_sector, %dl # %dl = sector
|
||||
movw b_bootseg, %es # %es = boot segment
|
||||
movb b_daua, %al # %al = DA/UA
|
||||
movw b_secsize, %bx
|
||||
shlw %bx # %bx = sector size * 2
|
||||
cli
|
||||
movw %cs:iniss, %ss # Restore stack pointer
|
||||
movw %cs:inisp, %sp
|
||||
push %es # Boot segment
|
||||
xorw %bp, %bp
|
||||
push %bp # 0
|
||||
movw %ax, %di # Save %ax
|
||||
xorw %ax, %ax
|
||||
movw %ax, %ds # %ds = 0
|
||||
movw %di, %ax # Restore %ax
|
||||
xorb %ah, %ah # %ah = 0
|
||||
xorw %di, %di # %di = 0
|
||||
sti
|
||||
|
||||
# Jump to bootstrap code
|
||||
lret
|
||||
# NOTREACHED
|
||||
|
||||
boot_error:
|
||||
ret
|
||||
|
||||
#
|
||||
# Try to boot from default partition.
|
||||
#
|
||||
.global trydefault
|
||||
trydefault:
|
||||
movw ndevice, %cx
|
||||
xorw %si, %si
|
||||
trydefault_loop:
|
||||
movw %si, curdevice
|
||||
push %cx
|
||||
push %si
|
||||
call read_ipl
|
||||
pop %si
|
||||
pop %cx
|
||||
cmpb $0x80, defpartflag
|
||||
jne nodefpart
|
||||
# Default partition is defined.
|
||||
push %cx
|
||||
movw npartition, %cx
|
||||
srch_part:
|
||||
movw %cx, %bx
|
||||
decw %bx
|
||||
movb defpartnum, %al # %al = real partition number
|
||||
cmpb partnum(%bx), %al
|
||||
jne not_match
|
||||
movw %bx, curpartition # Store partition number
|
||||
call boot
|
||||
not_match:
|
||||
loop srch_part
|
||||
pop %cx
|
||||
nodefpart:
|
||||
incw %si
|
||||
loop trydefault_loop
|
||||
ret
|
||||
|
||||
.data
|
||||
b_daua: .byte 0 # DA/UA
|
||||
b_head: .byte 0 # SYSH
|
||||
b_sector: .byte 0 # SYSS
|
||||
b_cylinder: .word 0 # SYSC
|
||||
b_bootseg: .word 0
|
||||
b_secsize: .word 0
|
||||
b_partn: .word 0 # Real partition number
|
@ -1,293 +0,0 @@
|
||||
# Copyright (c) KATO Takenori, 1999, 2000, 2007.
|
||||
#
|
||||
# All rights reserved. Unpublished rights reserved under the copyright
|
||||
# laws of Japan.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions
|
||||
# are met:
|
||||
#
|
||||
# 1. Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer as
|
||||
# the first lines of this file unmodified.
|
||||
# 2. Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
||||
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
# $FreeBSD$
|
||||
#
|
||||
.global main
|
||||
.code16
|
||||
|
||||
.text
|
||||
main:
|
||||
# Check hireso mode
|
||||
movw $0x501, %bx # BIOS_FLAG
|
||||
call read_biosparam
|
||||
testb $0x08, %dl
|
||||
jz normalmode
|
||||
movb $1, ishireso
|
||||
normalmode:
|
||||
call sc_init
|
||||
|
||||
# Display title and copyright.
|
||||
movw $title, %di
|
||||
call sc_puts
|
||||
xorw %cx, %cx
|
||||
movw $1, %dx
|
||||
call sc_goto
|
||||
movw $copyright, %di
|
||||
call sc_puts
|
||||
|
||||
# Scan hard drives
|
||||
xorw %si, %si # number of partition
|
||||
call scan_sasi # SASI/IDE
|
||||
call scan_scsi # SCSI
|
||||
movw %si, ndevice
|
||||
orw %si, %si
|
||||
jnz drives_found
|
||||
jmp exit # No hard drives
|
||||
|
||||
drives_found:
|
||||
# Setup sector size dependent parameters
|
||||
movw %si, %cx # %cx = number of devices
|
||||
setup_loop:
|
||||
movw %cx, %di
|
||||
decw %di
|
||||
shlw %di
|
||||
movw secsize(%di), %ax
|
||||
cmpw $1024, %ax
|
||||
je setup_1024
|
||||
cmpw $512, %ax
|
||||
je setup_512
|
||||
# 256 bytes/sector
|
||||
movw $0x100, partoff(%di)
|
||||
movw $0x0fa, defflagoff(%di)
|
||||
movw $0x0fb, defpartoff(%di)
|
||||
movw $8, maxpart(%di)
|
||||
jmp setup_secsize_end
|
||||
# 1024 bytes/sector
|
||||
setup_1024:
|
||||
# XXX Fix me!
|
||||
movw $0x400, partoff(%di)
|
||||
movw $0x3fa, defflagoff(%di)
|
||||
movw $0x3fb, defpartoff(%di)
|
||||
movb $32, maxpart(%di)
|
||||
jmp setup_secsize_end
|
||||
# 512 bytes/sector
|
||||
setup_512:
|
||||
movw $0x200, partoff(%di)
|
||||
movw $0x1fa, defflagoff(%di)
|
||||
movw $0x1fb, defpartoff(%di)
|
||||
movb $16, maxpart(%di)
|
||||
setup_secsize_end:
|
||||
loop setup_loop
|
||||
|
||||
# For debug with floppy, fake the parameter.
|
||||
movw $0x584, %bx # DISK_BOOT
|
||||
call read_biosparam
|
||||
andb $0xf0, %dl
|
||||
cmpb $0x90, %ah
|
||||
jne boot_from_hdd
|
||||
movb daua, %dl
|
||||
call write_biosparam
|
||||
|
||||
boot_from_hdd:
|
||||
movw $500, %cx
|
||||
wait_0_5:
|
||||
call wait1ms
|
||||
loop wait_0_5
|
||||
|
||||
# If the TAB is pressed, don't try to boot from default partition
|
||||
xorw %di, %di # flag
|
||||
wait_key_release:
|
||||
call sc_iskeypress
|
||||
orw %ax, %ax
|
||||
jz key_release # KBD buffer empty.
|
||||
call sc_getc
|
||||
cmpb $0x0f, %ah # TAB
|
||||
jne wait_key_release
|
||||
# TAB pressed
|
||||
movw $1, %di
|
||||
jmp wait_key_release
|
||||
key_release:
|
||||
orw %di, %di
|
||||
jnz dont_try_default # TAB pressed.
|
||||
call trydefault
|
||||
# Default partition not found.
|
||||
dont_try_default:
|
||||
call show_usage
|
||||
call showdevices
|
||||
call selector
|
||||
exit:
|
||||
ret
|
||||
#
|
||||
# Display usage
|
||||
#
|
||||
show_usage:
|
||||
movw $44, %cx
|
||||
movw $3, %dx
|
||||
call sc_goto
|
||||
movw $msg_usage1, %di
|
||||
call sc_puts
|
||||
movw $44, %cx
|
||||
movw $4, %dx
|
||||
call sc_goto
|
||||
movw $msg_usage2, %di
|
||||
call sc_puts
|
||||
movw $44, %cx
|
||||
movw $5, %dx
|
||||
call sc_goto
|
||||
movw $msg_usage3, %di
|
||||
call sc_puts
|
||||
movw $44, %cx
|
||||
movw $7, %dx
|
||||
call sc_goto
|
||||
movw $msg_usage4, %di
|
||||
call sc_puts
|
||||
movw $44, %cx
|
||||
movw $8, %dx
|
||||
call sc_goto
|
||||
movw $msg_usage5, %di
|
||||
call sc_puts
|
||||
movw $44, %cx
|
||||
movw $9, %dx
|
||||
call sc_goto
|
||||
movw $msg_usage6, %di
|
||||
call sc_puts
|
||||
movw $44, %cx
|
||||
movw $10, %dx
|
||||
call sc_goto
|
||||
movw $msg_usage7, %di
|
||||
call sc_puts
|
||||
movw $44, %cx
|
||||
movw $11, %dx
|
||||
call sc_goto
|
||||
movw $msg_usage8, %di
|
||||
call sc_puts
|
||||
movw $44, %cx
|
||||
movw $16, %dx
|
||||
call sc_goto
|
||||
movw $msg_usage9, %di
|
||||
call sc_puts
|
||||
movw $44, %cx
|
||||
movw $17, %dx
|
||||
call sc_goto
|
||||
movw $msg_usage10, %di
|
||||
call sc_puts
|
||||
movw $44, %cx
|
||||
movw $18, %dx
|
||||
call sc_goto
|
||||
movw $msg_usage11, %di
|
||||
call sc_puts
|
||||
movw $44, %cx
|
||||
movw $19, %dx
|
||||
call sc_goto
|
||||
movw $msg_usage12, %di
|
||||
call sc_puts
|
||||
ret
|
||||
|
||||
#
|
||||
# Display device list
|
||||
#
|
||||
showdevices:
|
||||
movw $2, %cx
|
||||
movw $4, %dx
|
||||
call sc_goto
|
||||
movw $msg_device, %di
|
||||
call sc_puts
|
||||
xorw %si, %si # %si = device number
|
||||
movw ndevice, %cx # %cx = number of devices
|
||||
showdev_loop:
|
||||
push %cx
|
||||
movw $2, %cx
|
||||
movw $5, %dx
|
||||
addw %si, %dx
|
||||
call sc_goto
|
||||
# Check DA
|
||||
movb daua(%si), %al
|
||||
push %ax
|
||||
andb $0xf0, %al
|
||||
cmpb $0x80, %al
|
||||
je show_sasi
|
||||
cmpb $0xa0, %al
|
||||
je show_scsi
|
||||
# unknown device
|
||||
movw $msg_unknown, %di
|
||||
call sc_puts
|
||||
jmp showunit
|
||||
# SASI
|
||||
show_sasi:
|
||||
movw $msg_sasi, %di
|
||||
call sc_puts
|
||||
jmp showunit
|
||||
# SCSI
|
||||
show_scsi:
|
||||
movw $msg_scsi, %di
|
||||
call sc_puts
|
||||
# Display unit number.
|
||||
showunit:
|
||||
pop %ax
|
||||
andb $0x0f, %al
|
||||
addb $'0', %al
|
||||
call sc_putc
|
||||
incw %si
|
||||
pop %cx
|
||||
loop showdev_loop
|
||||
movw ndevice, %dx
|
||||
addw $5, %dx
|
||||
movw $2, %cx
|
||||
call sc_goto
|
||||
movw $msg_exitmenu, %di
|
||||
call sc_puts
|
||||
ret
|
||||
|
||||
.data
|
||||
.global curdevice, ndevice
|
||||
ndevice: .word 0 # number of device
|
||||
curdevice: .word 0 # current device
|
||||
|
||||
.global ishireso
|
||||
ishireso: .byte 0
|
||||
|
||||
title: .asciz "PC98 Boot Selector Version 1.2"
|
||||
copyright: .ascii "(C)Copyright 1999-2007 KATO Takenori. "
|
||||
.asciz "All rights reserved."
|
||||
msg_device: .asciz "Device"
|
||||
msg_sasi: .asciz "SASI/IDE unit "
|
||||
msg_scsi: .asciz "SCSI ID "
|
||||
msg_unknown: .asciz "unknown unit "
|
||||
msg_exitmenu: .asciz "Exit this menu"
|
||||
msg_usage1: .asciz "Device list"
|
||||
msg_usage2: .asciz "UP, DOWN: select boot device"
|
||||
msg_usage3: .asciz "RETURN: move to slice list"
|
||||
msg_usage4: .asciz "Slice list"
|
||||
msg_usage5: .asciz "UP, DOWN: select boot slice"
|
||||
msg_usage6: .asciz "RETURN: boot"
|
||||
msg_usage7: .asciz "SPACE: toggle default"
|
||||
msg_usage8: .asciz "ESC: move to device list"
|
||||
msg_usage9: .asciz "LEGEND"
|
||||
msg_usage10: .asciz ">>: selected device/slice"
|
||||
msg_usage11: .asciz "*: default slice to boot"
|
||||
msg_usage12: .asciz "!: unbootable slice"
|
||||
|
||||
.bss
|
||||
.global daua, secsize, defflagoff, defpartoff
|
||||
.global maxpart, partoff
|
||||
daua: .space 12 # DA/DU list
|
||||
secsize: .space 12 * 2 # Sector soize
|
||||
defflagoff: .space 12 * 2
|
||||
defpartoff: .space 12 * 2
|
||||
maxpart: .space 12 * 2
|
||||
partoff: .space 12 * 2
|
@ -1,296 +0,0 @@
|
||||
# Copyright (c) KATO Takenori, 1999, 2000.
|
||||
#
|
||||
# All rights reserved. Unpublished rights reserved under the copyright
|
||||
# laws of Japan.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions
|
||||
# are met:
|
||||
#
|
||||
# 1. Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer as
|
||||
# the first lines of this file unmodified.
|
||||
# 2. Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
||||
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
# $FreeBSD$
|
||||
#
|
||||
|
||||
.code16
|
||||
.text
|
||||
#
|
||||
# Check magic number at the end of the sector 0
|
||||
#
|
||||
check_magic:
|
||||
movw curdevice, %si
|
||||
shlw %si
|
||||
movw secsize(%si), %bx
|
||||
decw %bx
|
||||
decw %bx
|
||||
movw iplbuf(%bx), %ax
|
||||
cmpw $0xaa55, %ax
|
||||
je magic_ok
|
||||
movw $1, %ax
|
||||
ret
|
||||
magic_ok:
|
||||
xorw %ax, %ax
|
||||
ret
|
||||
|
||||
#
|
||||
# Copy partition table from buffer to parttable.
|
||||
#
|
||||
setup_partition:
|
||||
push %cs
|
||||
pop %es
|
||||
movw curdevice, %bx
|
||||
shlw %bx
|
||||
movw maxpart(%bx), %cx # %cx = max num of partitions
|
||||
movw partoff(%bx), %di
|
||||
movw %di, %bx # %bx = offset to partition table
|
||||
xorw %dx, %dx # %dx = partition number
|
||||
setup_partition_loop:
|
||||
push %cx
|
||||
movw %dx, %si
|
||||
movb $5, %cl
|
||||
shlw %cl, %si
|
||||
addw %bx, %si
|
||||
movb iplbuf(%si), %al
|
||||
orb %al, %al
|
||||
jz unused_partition
|
||||
addw $iplbuf, %si
|
||||
movw npartition, %ax
|
||||
movw %ax, %di
|
||||
movb $5, %cl
|
||||
shlw %cl, %di
|
||||
addw $parttable, %di
|
||||
movw $32, %cx
|
||||
rep
|
||||
movsb
|
||||
movw %ax, %di
|
||||
addw $partnum, %di
|
||||
movb %dl, (%di)
|
||||
incw npartition
|
||||
unused_partition:
|
||||
incw %dx
|
||||
pop %cx
|
||||
loop setup_partition_loop
|
||||
ret
|
||||
|
||||
#
|
||||
# Read IPL and partition table in the current device.
|
||||
#
|
||||
.global read_ipl
|
||||
read_ipl:
|
||||
movw curdevice, %ax
|
||||
movw %ax, %si # %si = device number
|
||||
movw %ax, %di
|
||||
shlw %di
|
||||
|
||||
movw %cs, %ax
|
||||
movw %ax, %es
|
||||
movb $6, %ah
|
||||
movb daua(%si), %al
|
||||
movw $0x400, %bx
|
||||
xorw %cx, %cx
|
||||
xorw %dx, %dx
|
||||
movw $iplbuf, %bp
|
||||
int $0x1b
|
||||
jc read_ipl_error
|
||||
movw defflagoff(%di), %bx
|
||||
movb iplbuf(%bx), %al
|
||||
movb %al, defpartflag
|
||||
incw %bx
|
||||
movb iplbuf(%bx), %al
|
||||
movb %al, defpartnum
|
||||
movw $0, npartition
|
||||
call check_magic
|
||||
orw %ax, %ax
|
||||
jnz no_magic
|
||||
call setup_partition
|
||||
no_magic:
|
||||
xorw %ax, %ax
|
||||
read_ipl_error:
|
||||
xorw %bx, %bx
|
||||
movw %bx, %es
|
||||
ret
|
||||
|
||||
#
|
||||
# Restore IPL from the buffer
|
||||
#
|
||||
.global write_ipl
|
||||
write_ipl:
|
||||
movw curdevice, %ax
|
||||
movw %ax, %si
|
||||
movw %ax, %di
|
||||
shlw %di
|
||||
|
||||
# Restore default boot partition info.
|
||||
movw defflagoff(%di), %bx
|
||||
movb defpartflag, %al
|
||||
movb %al, iplbuf(%bx)
|
||||
incw %bx
|
||||
movb defpartnum, %al
|
||||
movb %al, iplbuf(%bx)
|
||||
|
||||
movw %cs, %ax
|
||||
movw %ax, %es
|
||||
movb $5, %ah
|
||||
movb daua(%si), %al
|
||||
movw secsize(%di), %bx
|
||||
xorw %cx, %cx
|
||||
xorw %dx, %dx
|
||||
movw $iplbuf, %bp
|
||||
int $0x1b
|
||||
jc write_ipl_error
|
||||
xorw %ax, %ax
|
||||
write_ipl_error:
|
||||
xorw %bx, %bx
|
||||
movw %bx, %es
|
||||
ret
|
||||
|
||||
#
|
||||
# Scan HDD devices
|
||||
#
|
||||
.global scan_sasi, scan_scsi
|
||||
# Scan SASI disk
|
||||
scan_sasi:
|
||||
# SASI Disk
|
||||
movw $4, %cx
|
||||
movw $0x0001, %ax # %ah = unit number, %al = for bit operation
|
||||
|
||||
sasi_loop:
|
||||
movw %si, %di
|
||||
shlw %di
|
||||
movw $0x55d, %bx # DISK_EQUIP
|
||||
call read_biosparam
|
||||
testb %al, %dl
|
||||
jz no_sasi_unit
|
||||
movb $0x80, %dh
|
||||
addb %ah, %dh # %dh = DA/UA
|
||||
movb %dh, daua(%si) # Store DA/UA
|
||||
|
||||
# Try new sense command
|
||||
push %ax
|
||||
push %cx
|
||||
movb %dh, %al
|
||||
movb $0x84, %ah
|
||||
int $0x1b
|
||||
pop %cx
|
||||
pop %ax
|
||||
jc err_newsense
|
||||
movw %bx, %dx
|
||||
jmp found_sasi_unit
|
||||
|
||||
err_newsense:
|
||||
movw $0x457, %bx # capacity & sector size of IDE HDD
|
||||
call read_biosparam
|
||||
orb %ah, %ah
|
||||
jz sasi_1
|
||||
cmpb $1, %ah
|
||||
jz sasi_2
|
||||
|
||||
# SASI #3/#4
|
||||
movw $512, %dx # XXX
|
||||
jmp found_sasi_unit
|
||||
|
||||
sasi_1:
|
||||
# SASI #1
|
||||
testb $0x80, %dl
|
||||
jz sasi_256
|
||||
jmp sasi_512
|
||||
sasi_2:
|
||||
# SASI #2
|
||||
testb $0x40, %dl
|
||||
jz sasi_256
|
||||
jmp sasi_512
|
||||
|
||||
sasi_256:
|
||||
movw $256, %dx
|
||||
jmp found_sasi_unit
|
||||
sasi_512:
|
||||
movw $512, %dx
|
||||
found_sasi_unit:
|
||||
movw %dx, secsize(%di)
|
||||
incw %si
|
||||
no_sasi_unit:
|
||||
incb %ah
|
||||
shlb %al
|
||||
loop sasi_loop
|
||||
ret
|
||||
|
||||
#
|
||||
# Scan SCSI disk
|
||||
# SI number of disks
|
||||
# destroyed: %ax, %bx, %cx, %dx
|
||||
scan_scsi:
|
||||
movw $8, %cx
|
||||
movw $0x0001, %ax # %ah = ID number, %al = for bit operation
|
||||
scsi_loop:
|
||||
# Check whether drive exist.
|
||||
movw %si, %di
|
||||
shlw %di
|
||||
movw $0x482, %bx # DISK_EQUIPS
|
||||
call read_biosparam
|
||||
testb %al, %dl
|
||||
jz no_scsi_unit
|
||||
xorw %bx, %bx
|
||||
movb %ah, %bl
|
||||
shlw %bx
|
||||
shlw %bx
|
||||
addw $0x460, %bx # SCSI parameter block
|
||||
call read_biosparam
|
||||
orb %dl, %dl
|
||||
jz no_scsi_unit
|
||||
|
||||
# SCSI harddrive found.
|
||||
movb $0xa0, %dh
|
||||
addb %ah, %dh
|
||||
movb %dh, daua(%si)
|
||||
|
||||
# Check sector size.
|
||||
addw $3, %bx
|
||||
call read_biosparam
|
||||
andb $0x30, %dl
|
||||
cmpb $0x20, %dl
|
||||
je scsi_1024
|
||||
cmpb $0x10, %dl
|
||||
je scsi_512
|
||||
movw $256, %dx
|
||||
jmp found_scsi
|
||||
scsi_1024:
|
||||
movw $1024, %dx
|
||||
jmp found_scsi
|
||||
scsi_512:
|
||||
movw $512, %dx
|
||||
found_scsi:
|
||||
movw %dx, secsize(%di)
|
||||
incw %si
|
||||
no_scsi_unit:
|
||||
incb %ah
|
||||
shlb %al
|
||||
loop scsi_loop
|
||||
ret
|
||||
|
||||
.data
|
||||
.global defpartflag, defpartnum, npartition
|
||||
defpartflag: .byte 0
|
||||
defpartnum: .byte 0
|
||||
npartition: .word 0 # number of partitions
|
||||
|
||||
.bss
|
||||
.global partnum, parttable
|
||||
iplbuf: .space 0x400 # Read buffer for IPL
|
||||
partnum: .space 32 # Index of parttable
|
||||
parttable: .space 1024 # Copy of valid partition table
|
@ -1,12 +0,0 @@
|
||||
/*
|
||||
* $FreeBSD$
|
||||
*/
|
||||
|
||||
SECTIONS
|
||||
{
|
||||
.text : { *(.text) }
|
||||
.data : { *(.data) }
|
||||
. = 0x1243;
|
||||
.putssjis : { *(.putssjis) }
|
||||
.bss : { *(.bss) }
|
||||
}
|
@ -1,137 +0,0 @@
|
||||
# Copyright (c) KATO Takenori, 2007.
|
||||
#
|
||||
# All rights reserved. Unpublished rights reserved under the copyright
|
||||
# laws of Japan.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions
|
||||
# are met:
|
||||
#
|
||||
# 1. Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer as
|
||||
# the first lines of this file unmodified.
|
||||
# 2. Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
||||
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
# $FreeBSD$
|
||||
#
|
||||
|
||||
.code16
|
||||
.section .putssjis, "awx", @progbits
|
||||
|
||||
#
|
||||
# Display string with Shift-JIS support
|
||||
# %si: address of string, %di: T-VRAM address, %cx: count
|
||||
#
|
||||
|
||||
# Absolute address of putssjis_entry must be 0x1243.
|
||||
putssjis_entry:
|
||||
push %es
|
||||
push %ax
|
||||
# Setup the T-VRAM segement address.
|
||||
xorw %ax, %ax
|
||||
movw %ax, %es
|
||||
movw $0xa000, %ax
|
||||
testb $0x08, %es:0x501
|
||||
jz normalmode
|
||||
movw $0xe000, %ax
|
||||
normalmode:
|
||||
movw %ax, %es
|
||||
|
||||
putssjis_loop:
|
||||
lodsw
|
||||
call check_sjis
|
||||
jc put_2byte_char
|
||||
|
||||
# 1 byte character
|
||||
xorb %ah, %ah
|
||||
testb $0xe0, %al # Check control code.
|
||||
jnz put_1byte_char
|
||||
movb $0x20, %al # Convert control code into the space.
|
||||
put_1byte_char:
|
||||
stosw
|
||||
decw %si
|
||||
jmp putssjis_loop_end
|
||||
|
||||
put_2byte_char:
|
||||
subb $0x20, %al
|
||||
|
||||
# Check 2byte "hankaku"
|
||||
cmp $0x09, %al
|
||||
je put_2byte_hankaku
|
||||
cmp $0x0a, %al
|
||||
je put_2byte_hankaku
|
||||
cmp $0x0b, %al
|
||||
je put_2byte_hankaku
|
||||
jmp put_2byte_zenkaku
|
||||
|
||||
put_2byte_hankaku:
|
||||
stosw
|
||||
jmp putssjis_loop_end
|
||||
|
||||
put_2byte_zenkaku:
|
||||
stosw
|
||||
orb $0x80, %ah
|
||||
stosw
|
||||
decw %cx
|
||||
|
||||
putssjis_loop_end:
|
||||
loop putssjis_loop
|
||||
|
||||
pop %ax
|
||||
pop %es
|
||||
ret
|
||||
|
||||
# Check 2-byte code.
|
||||
check_sjis:
|
||||
cmpb $0x80, %al
|
||||
jbe found_ank_kana
|
||||
cmpb $0xa0, %al
|
||||
jb found_2byte_char
|
||||
cmpb $0xe0, %al
|
||||
jb found_ank_kana
|
||||
cmpb $0xf0, %al
|
||||
jae found_ank_kana
|
||||
jmp found_2byte_char
|
||||
found_ank_kana:
|
||||
clc
|
||||
ret
|
||||
|
||||
found_2byte_char:
|
||||
# Convert Shift-JIS into JIS.
|
||||
cmpb $0x9f, %al
|
||||
ja sjis_h_2 # Upper > 0x9f
|
||||
subb $0x71, %al # Upper -= 0x71
|
||||
jmp sjis_lower
|
||||
sjis_h_2:
|
||||
subb $0xb1, %al # Upper -= 0xb1
|
||||
sjis_lower:
|
||||
salb %al # Upper *= 2
|
||||
incb %al # Upper += 1
|
||||
|
||||
cmpb $0x7f, %ah
|
||||
jbe sjis_l_2
|
||||
decb %ah # Lower -= 1 if lower > 0x7f
|
||||
sjis_l_2:
|
||||
cmpb $0x9e, %ah
|
||||
jb sjis_l_3
|
||||
subb $0x7d, %ah # Lower -= 0x7d
|
||||
incb %al # Upper += 1
|
||||
jmp check_2byte_end
|
||||
sjis_l_3:
|
||||
subb $0x1f, %ah # Lower -= 0x1f
|
||||
check_2byte_end:
|
||||
stc
|
||||
ret
|
@ -1,450 +0,0 @@
|
||||
# Copyright (c) KATO Takenori, 1999, 2000, 2007.
|
||||
#
|
||||
# All rights reserved. Unpublished rights reserved under the copyright
|
||||
# laws of Japan.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions
|
||||
# are met:
|
||||
#
|
||||
# 1. Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer as
|
||||
# the first lines of this file unmodified.
|
||||
# 2. Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
||||
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
# $FreeBSD$
|
||||
#
|
||||
|
||||
.code16
|
||||
|
||||
.text
|
||||
#
|
||||
# Display partition table.
|
||||
#
|
||||
showpartitions:
|
||||
# Clear partition table area
|
||||
movw $16, %cx
|
||||
clear_part:
|
||||
push %cx
|
||||
movw %cx, %dx
|
||||
decw %dx
|
||||
addw $5, %dx
|
||||
movw $20, %cx
|
||||
call sc_goto
|
||||
movw $msg_spc, %di
|
||||
call sc_puts
|
||||
pop %cx
|
||||
loop clear_part
|
||||
|
||||
# Check `Exit' menu
|
||||
movw curdevice, %ax
|
||||
cmpw ndevice, %ax
|
||||
je no_slice
|
||||
|
||||
# XXX Move this to a suitable place!
|
||||
movw $22, %cx
|
||||
movw $4, %dx
|
||||
call sc_goto
|
||||
movw $msg_slice, %di
|
||||
call sc_puts
|
||||
|
||||
# Check the number of partitions
|
||||
movw npartition, %cx
|
||||
orw %cx, %cx
|
||||
jnz partitionexist
|
||||
no_slice:
|
||||
# Just show the `no slice' message.
|
||||
movw $22, %cx
|
||||
movw $5, %dx
|
||||
call sc_goto
|
||||
movw $msg_noslice, %di
|
||||
call sc_puts
|
||||
ret
|
||||
partitionexist:
|
||||
xorw %si, %si # %si = partition number
|
||||
showpart_loop:
|
||||
push %cx # %cx = number of partitions
|
||||
movw $22, %cx
|
||||
movw %si, %dx
|
||||
addw $5, %dx
|
||||
call sc_goto
|
||||
movw %si, %di
|
||||
movb $5, %cl
|
||||
shlw %cl, %di
|
||||
addw $0x10, %di # SYSM field
|
||||
# SYSM: space filled string. Don't use sc_puts.
|
||||
movw $16, %cx
|
||||
showpart_name:
|
||||
push %cx
|
||||
movb parttable(%di), %al
|
||||
call sc_putc
|
||||
incw %di
|
||||
pop %cx
|
||||
loop showpart_name
|
||||
incw %si
|
||||
pop %cx
|
||||
loop showpart_loop
|
||||
ret
|
||||
|
||||
#
|
||||
# Show default slice indicator
|
||||
# If the default boot slice exists, `*' indicator will be showed.
|
||||
#
|
||||
showdefaultslicemark:
|
||||
cmpb $0x80, defpartflag
|
||||
je defpartexist
|
||||
ret
|
||||
defpartexist:
|
||||
movw npartition, %cx
|
||||
defslice_loop:
|
||||
movw %cx, %bx
|
||||
decw %bx
|
||||
push %cx
|
||||
push %bx
|
||||
movw $40, %cx
|
||||
movw %bx, %dx
|
||||
addw $5, %dx
|
||||
call sc_goto
|
||||
|
||||
pop %bx
|
||||
pop %cx
|
||||
movb defpartnum, %al
|
||||
cmpb partnum(%bx), %al
|
||||
jne nomatch
|
||||
movb $'*', %al
|
||||
call sc_putc
|
||||
jmp defslice_done
|
||||
nomatch:
|
||||
movb $' ', %al
|
||||
call sc_putc
|
||||
defslice_done:
|
||||
loop defslice_loop
|
||||
ret
|
||||
|
||||
#
|
||||
# Hide default slice indicator
|
||||
#
|
||||
hidedefaultslicemark:
|
||||
movw $16, %cx
|
||||
hidedefslice_loop:
|
||||
push %cx
|
||||
movw %cx, %dx
|
||||
addw $4, %dx
|
||||
movw $40, %cx
|
||||
call sc_goto
|
||||
movb $' ', %al
|
||||
call sc_putc
|
||||
pop %cx
|
||||
loop hidedefslice_loop
|
||||
ret
|
||||
|
||||
#
|
||||
# Toggle default slice
|
||||
#
|
||||
toggle_default:
|
||||
cmpb $0x80, defpartflag
|
||||
jne set_default
|
||||
# Clear default
|
||||
movb $0, defpartflag
|
||||
call write_ipl # Restore
|
||||
call hidedefaultslicemark
|
||||
ret
|
||||
# Set default slice
|
||||
set_default:
|
||||
movw curpartition, %si
|
||||
movb partnum(%si), %al # %al = real partition number
|
||||
movb $5, %cl
|
||||
shlw %cl, %si
|
||||
# Default slice must be bootable
|
||||
testb $0x80, parttable(%si)
|
||||
jnz curpart_bootable
|
||||
# Current partition is not bootable.
|
||||
ret
|
||||
curpart_bootable:
|
||||
movb $0x80, defpartflag
|
||||
movb %al, defpartnum
|
||||
call write_ipl # Restore
|
||||
call showdefaultslicemark
|
||||
ret
|
||||
|
||||
#
|
||||
# Show/hide cursor
|
||||
#
|
||||
show_devcurs:
|
||||
xorw %cx, %cx
|
||||
movw curdevice, %dx
|
||||
addw $5, %dx
|
||||
call sc_goto
|
||||
movb $'>', %al
|
||||
call sc_putc
|
||||
movb $'>', %al
|
||||
call sc_putc
|
||||
ret
|
||||
|
||||
hide_devcurs:
|
||||
xorw %cx, %cx
|
||||
movw curdevice, %dx
|
||||
addw $5, %dx
|
||||
call sc_goto
|
||||
movb $' ', %al
|
||||
call sc_putc
|
||||
movb $' ', %al
|
||||
call sc_putc
|
||||
ret
|
||||
|
||||
show_slicecurs:
|
||||
movw $20, %cx
|
||||
movw curpartition, %dx
|
||||
addw $5, %dx
|
||||
call sc_goto
|
||||
movb $'>', %al
|
||||
call sc_putc
|
||||
movb $'>', %al
|
||||
call sc_putc
|
||||
ret
|
||||
|
||||
hide_slicecurs:
|
||||
movw $20, %cx
|
||||
movw curpartition, %dx
|
||||
addw $5, %dx
|
||||
call sc_goto
|
||||
movb $' ', %al
|
||||
call sc_putc
|
||||
movb $' ', %al
|
||||
call sc_putc
|
||||
ret
|
||||
|
||||
isforceboot:
|
||||
xorw %cx, %cx
|
||||
movw $20, %dx
|
||||
call sc_goto
|
||||
movw $msg_force, %di
|
||||
call sc_puts
|
||||
call sc_getc
|
||||
push %ax
|
||||
xorw %cx, %cx
|
||||
movw $20, %dx
|
||||
call sc_goto
|
||||
movw $msg_forceclr, %di
|
||||
call sc_puts
|
||||
pop %ax
|
||||
cmpb $0x15, %ah
|
||||
je force_yes
|
||||
xorw %ax, %ax
|
||||
ret
|
||||
force_yes:
|
||||
movw $1, %ax
|
||||
ret
|
||||
|
||||
#
|
||||
# Main loop for device mode
|
||||
#
|
||||
devmode:
|
||||
call read_ipl
|
||||
call hidedefaultslicemark
|
||||
call showpartitions
|
||||
call showdefaultslicemark
|
||||
call show_devcurs
|
||||
|
||||
movw $2, %cx
|
||||
movw $4, %dx
|
||||
call sc_goto
|
||||
movb $0xe5, %al
|
||||
movw $6, %cx
|
||||
call sc_setattr
|
||||
movw $22, %cx
|
||||
movw $4, %dx
|
||||
call sc_goto
|
||||
movb $0xe1, %al
|
||||
movw $5, %cx
|
||||
call sc_setattr
|
||||
movw $44, %cx
|
||||
movw $3, %dx
|
||||
call sc_goto
|
||||
movb $0xe5, %al
|
||||
movw $11, %cx
|
||||
call sc_setattr
|
||||
movw $44, %cx
|
||||
movw $7, %dx
|
||||
call sc_goto
|
||||
movb $0xe1, %al
|
||||
movw $10, %cx
|
||||
call sc_setattr
|
||||
|
||||
devmode_loop:
|
||||
call sc_getc
|
||||
movw ndevice, %bx
|
||||
cmpb $0x3a, %ah # UP
|
||||
je dev_up
|
||||
cmpb $0x3d, %ah # DOWN
|
||||
je dev_down
|
||||
cmpb $0x3c, %ah # RIGHT
|
||||
je dev_right
|
||||
cmpb $0x1c, %ah # RETURN
|
||||
jne devmode_loop
|
||||
cmpw curdevice, %bx
|
||||
jne dev_right
|
||||
movw $3, mode # N88-BASIC
|
||||
ret
|
||||
|
||||
# XXX
|
||||
.space 5, 0x90
|
||||
ret # Dummy ret @0x9ab
|
||||
|
||||
dev_up:
|
||||
cmpw $0, curdevice
|
||||
je devmode_loop
|
||||
call hide_devcurs
|
||||
decw curdevice
|
||||
call read_ipl
|
||||
call hidedefaultslicemark
|
||||
call showpartitions
|
||||
call showdefaultslicemark
|
||||
call show_devcurs
|
||||
jmp devmode_loop
|
||||
dev_down:
|
||||
cmpw curdevice, %bx
|
||||
je devmode_loop
|
||||
call hide_devcurs
|
||||
incw curdevice
|
||||
call read_ipl
|
||||
call hidedefaultslicemark
|
||||
call showpartitions
|
||||
call showdefaultslicemark
|
||||
call show_devcurs
|
||||
jmp devmode_loop
|
||||
dev_right:
|
||||
cmpw curdevice, %bx
|
||||
je devmode_loop
|
||||
movw $1, mode # Slice mode
|
||||
ret
|
||||
|
||||
#
|
||||
# main loop for slice mode
|
||||
#
|
||||
slicemode:
|
||||
movw $0, curpartition
|
||||
call show_slicecurs
|
||||
movw $2, %cx
|
||||
movw $4, %dx
|
||||
call sc_goto
|
||||
movb $0xe1, %al
|
||||
movw $6, %cx
|
||||
call sc_setattr
|
||||
movw $22, %cx
|
||||
movw $4, %dx
|
||||
call sc_goto
|
||||
movb $0xe5, %al
|
||||
movw $5, %cx
|
||||
call sc_setattr
|
||||
movw $44, %cx
|
||||
movw $3, %dx
|
||||
call sc_goto
|
||||
movb $0xe1, %al
|
||||
movw $11, %cx
|
||||
call sc_setattr
|
||||
movw $44, %cx
|
||||
movw $7, %dx
|
||||
call sc_goto
|
||||
movb $0xe5, %al
|
||||
movw $10, %cx
|
||||
call sc_setattr
|
||||
|
||||
slicemode_loop:
|
||||
call sc_getc
|
||||
cmpb $0x3a, %ah # UP
|
||||
je slice_up
|
||||
cmpb $0x3d, %ah # DOWN
|
||||
je slice_down
|
||||
cmpb $0x3b, %ah # LEFT
|
||||
je slice_esc
|
||||
cmpb $0x00, %ah # ESC
|
||||
je slice_esc
|
||||
cmpb $0x1c, %ah # RETURN
|
||||
je slice_ret
|
||||
cmpb $0x34, %ah # SPC
|
||||
je slice_spc
|
||||
cmpb $0x62, %ah # f1
|
||||
je slice_spc
|
||||
jmp slicemode_loop
|
||||
slice_up:
|
||||
cmpw $0, curpartition
|
||||
je slicemode_loop
|
||||
call hide_slicecurs
|
||||
decw curpartition
|
||||
call show_slicecurs
|
||||
jmp slicemode_loop
|
||||
slice_down:
|
||||
movw curpartition, %bx
|
||||
movw npartition, %ax
|
||||
decw %ax
|
||||
cmpw %bx, %ax
|
||||
je slicemode_loop
|
||||
call hide_slicecurs
|
||||
incw curpartition
|
||||
call show_slicecurs
|
||||
jmp slicemode_loop
|
||||
slice_esc:
|
||||
movw $0, mode # Device mode
|
||||
ret
|
||||
slice_spc:
|
||||
call toggle_default
|
||||
jmp slicemode_loop
|
||||
slice_ret:
|
||||
# Test bit 7 of mid
|
||||
movw curpartition, %si
|
||||
movb $5, %cl
|
||||
shlw %cl, %si
|
||||
testb $0x80, parttable(%si)
|
||||
jnz bootable_slice
|
||||
call isforceboot
|
||||
orw %ax, %ax
|
||||
jz slicemode_loop
|
||||
bootable_slice:
|
||||
call boot
|
||||
jmp slicemode_loop
|
||||
|
||||
#
|
||||
# Main loop
|
||||
#
|
||||
.global selector
|
||||
selector:
|
||||
movw $0, curdevice # trydefault may change the curdevice.
|
||||
movw $0, mode
|
||||
|
||||
selector_loop:
|
||||
cmpw $0, mode
|
||||
je status_dev
|
||||
cmpw $1, mode
|
||||
je status_slice
|
||||
ret
|
||||
status_dev:
|
||||
call devmode
|
||||
jmp selector_loop
|
||||
status_slice:
|
||||
call slicemode
|
||||
jmp selector_loop
|
||||
|
||||
.data
|
||||
.global curpartition
|
||||
curpartition: .word 0 # current patition
|
||||
mode: .word 0
|
||||
|
||||
msg_spc: .asciz " "
|
||||
msg_slice: .asciz "Slice"
|
||||
msg_noslice: .asciz "no slice"
|
||||
msg_force: .asciz "This slice is not bootable. Continue? (Y / [N])"
|
||||
msg_forceclr: .asciz " "
|
@ -1,73 +0,0 @@
|
||||
# Copyright (c) KATO Takenori, 1999, 2000, 2007.
|
||||
#
|
||||
# All rights reserved. Unpublished rights reserved under the copyright
|
||||
# laws of Japan.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions
|
||||
# are met:
|
||||
#
|
||||
# 1. Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer as
|
||||
# the first lines of this file unmodified.
|
||||
# 2. Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
||||
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
# $FreeBSD$
|
||||
#
|
||||
.global start
|
||||
.code16
|
||||
|
||||
.text
|
||||
start:
|
||||
jmp start1
|
||||
|
||||
# Magic
|
||||
.org 0x053, 0x20
|
||||
.byte 0x4e, 0x45, 0x43
|
||||
|
||||
.org 0x8f
|
||||
.byte 0x32, 0x2e, 0x37, 0x30
|
||||
|
||||
.org 0x2d4
|
||||
start1:
|
||||
# The instruction 'call 0x9ab' can be here. See also selector.s.
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
cli
|
||||
movw %cs, %ax
|
||||
movw %ax, %ds
|
||||
movw %ss, iniss
|
||||
movw %sp, inisp
|
||||
movw %ax, %ss
|
||||
movw $0xfffe, %sp
|
||||
sti
|
||||
xorw %ax, %ax
|
||||
movw %ax, %es
|
||||
call main
|
||||
|
||||
cli
|
||||
movw %cs:iniss, %ss
|
||||
movw %cs:inisp, %sp
|
||||
sti
|
||||
int $0x1e
|
||||
# NOTREACHED
|
||||
lret
|
||||
|
||||
.data
|
||||
.global iniss, inisp
|
||||
iniss: .word 0
|
||||
inisp: .word 0
|
@ -1,94 +0,0 @@
|
||||
# Copyright (c) KATO Takenori, 1999, 2000.
|
||||
#
|
||||
# All rights reserved. Unpublished rights reserved under the copyright
|
||||
# laws of Japan.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions
|
||||
# are met:
|
||||
#
|
||||
# 1. Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer as
|
||||
# the first lines of this file unmodified.
|
||||
# 2. Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
||||
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
# $FreeBSD$
|
||||
#
|
||||
|
||||
.code16
|
||||
|
||||
.text
|
||||
#
|
||||
# Wait 1ms
|
||||
#
|
||||
.global wait1ms
|
||||
wait1ms:
|
||||
push %cx
|
||||
movw $800, %cx
|
||||
wait_loop:
|
||||
outb %al, $0x5f
|
||||
loop wait_loop
|
||||
pop %cx
|
||||
ret
|
||||
|
||||
#
|
||||
# Read one byte from BIOS parameter block
|
||||
# %bx offset
|
||||
# %dl value
|
||||
#
|
||||
.global read_biosparam
|
||||
read_biosparam:
|
||||
movb %es:(%bx), %dl
|
||||
ret
|
||||
|
||||
#
|
||||
# Write one byte to BIOS parameter block
|
||||
# %bx offset
|
||||
# %dl value
|
||||
#
|
||||
.global write_biosparam
|
||||
write_biosparam:
|
||||
movb %dl, %es:(%bx)
|
||||
ret
|
||||
|
||||
#
|
||||
# beep
|
||||
#
|
||||
.global beep_on, beep_off, beep
|
||||
beep_on:
|
||||
movb $0x17, %ah
|
||||
int $0x18
|
||||
ret
|
||||
|
||||
beep_off:
|
||||
movb $0x18, %ah
|
||||
int $0x18
|
||||
ret
|
||||
|
||||
beep:
|
||||
push %cx
|
||||
call beep_on
|
||||
movw $100, %cx
|
||||
beep_loop1:
|
||||
call wait1ms
|
||||
loop beep_loop1
|
||||
call beep_off
|
||||
movw $50, %cx
|
||||
beep_loop2:
|
||||
call wait1ms
|
||||
loop beep_loop2
|
||||
pop %cx
|
||||
ret
|
@ -1,253 +0,0 @@
|
||||
# Copyright (c) KATO Takenori, 1999, 2000.
|
||||
#
|
||||
# All rights reserved. Unpublished rights reserved under the copyright
|
||||
# laws of Japan.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions
|
||||
# are met:
|
||||
#
|
||||
# 1. Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer as
|
||||
# the first lines of this file unmodified.
|
||||
# 2. Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
||||
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
# $FreeBSD$
|
||||
#
|
||||
|
||||
.code16
|
||||
|
||||
.text
|
||||
#
|
||||
# %al character code
|
||||
# destroyed: %al, %bx
|
||||
#
|
||||
put_character:
|
||||
movw $0xe000, %bx
|
||||
movb ishireso, %ah
|
||||
orb %ah, %ah
|
||||
jne hireso_ch
|
||||
movw $0xa000, %bx
|
||||
hireso_ch:
|
||||
movw %bx, %es
|
||||
xorb %ah, %ah
|
||||
movw curpos, %bx
|
||||
movw %ax, %es:(%bx)
|
||||
xorw %ax, %ax
|
||||
movw %ax, %es
|
||||
ret
|
||||
|
||||
#
|
||||
# %al attribute
|
||||
# destroyed: %ah, %cx
|
||||
#
|
||||
set_attribute:
|
||||
movw $0xe200, %bx
|
||||
movb ishireso, %ah
|
||||
orb %ah, %ah
|
||||
jne hireso_ch
|
||||
movw $0xa200, %bx
|
||||
hireso_attr:
|
||||
movw %bx, %es
|
||||
xorb %ah, %ah
|
||||
movw curpos, %bx
|
||||
movw %ax, %es:(%bx)
|
||||
xorw %bx, %bx
|
||||
movw %bx, %es
|
||||
ret
|
||||
|
||||
#
|
||||
# Put a character
|
||||
# %al: character code
|
||||
# destroyed: %ah, %bx, %cx
|
||||
#
|
||||
.global sc_putc
|
||||
sc_putc:
|
||||
call put_character
|
||||
incw curpos
|
||||
incw curpos
|
||||
cmpw $4000, curpos
|
||||
jng putc_end
|
||||
movw $0, curpos
|
||||
putc_end:
|
||||
ret
|
||||
|
||||
#
|
||||
# Put a null terminated string
|
||||
# %di: pointer to string
|
||||
# destroyed: %ah, %cx, %di
|
||||
#
|
||||
.global sc_puts
|
||||
sc_puts:
|
||||
movb (%di), %al
|
||||
orb %al, %al
|
||||
jz puts_end
|
||||
call sc_putc
|
||||
incw %di
|
||||
jmp sc_puts
|
||||
puts_end:
|
||||
ret
|
||||
|
||||
#
|
||||
# Change the current cursor position
|
||||
# %cx: X
|
||||
# %dx: Y
|
||||
# destroyed: %ax, %bx
|
||||
#
|
||||
.global sc_goto
|
||||
sc_goto:
|
||||
movw %dx, %ax # AX=Y
|
||||
shlw %ax # AX=Y*64
|
||||
shlw %ax
|
||||
shlw %ax
|
||||
shlw %ax
|
||||
shlw %ax
|
||||
shlw %ax
|
||||
movw %dx, %bx # BX=Y
|
||||
shlw %bx # BX=Y*16
|
||||
shlw %bx
|
||||
shlw %bx
|
||||
shlw %bx
|
||||
addw %bx, %ax # AX=Y*64+Y*16=Y*80
|
||||
addw %cx, %ax
|
||||
shlw %ax
|
||||
movw %ax, curpos
|
||||
ret
|
||||
|
||||
#
|
||||
# Clear screen
|
||||
# destroyed: %ax, %bx
|
||||
#
|
||||
.global sc_clean
|
||||
sc_clean:
|
||||
movb $0x16, %ah
|
||||
movw $0xe120, %dx
|
||||
int $0x18 # KBD/CRT BIOS
|
||||
movw $0, curpos
|
||||
ret
|
||||
|
||||
#
|
||||
# Set sttribute code
|
||||
# %al: attribute
|
||||
# %cx: count
|
||||
# destroyed: %ax, %bx, %cx
|
||||
#
|
||||
.global sc_setattr
|
||||
sc_setattr:
|
||||
call set_attribute
|
||||
incw curpos
|
||||
incw curpos
|
||||
loop sc_setattr
|
||||
|
||||
#
|
||||
# Sense the state of shift key
|
||||
# destroyed: %ax
|
||||
#
|
||||
.global sc_getshiftkey
|
||||
sc_getshiftkey:
|
||||
movb $2, %ah # Sense KB_SHIFT_COD
|
||||
int $0x18 # KBD/CRT BIOS
|
||||
xorb %ah, %ah
|
||||
ret
|
||||
|
||||
#
|
||||
# Check KBD buffer
|
||||
#
|
||||
.global sc_iskeypress
|
||||
sc_iskeypress:
|
||||
mov $1, %ah
|
||||
int $0x18 # KBD/CRT BIOS
|
||||
testb $1, %bh
|
||||
jz no_key
|
||||
movw $1, %ax
|
||||
ret
|
||||
no_key:
|
||||
xorw %ax, %ax
|
||||
ret
|
||||
|
||||
#
|
||||
# Read from KBD
|
||||
#
|
||||
.global sc_getc
|
||||
sc_getc:
|
||||
xorb %ah, %ah
|
||||
int $0x18
|
||||
ret
|
||||
|
||||
#
|
||||
# Initialize CRT (normal mode)
|
||||
#
|
||||
init_screen_normal:
|
||||
# Disable graphic screen
|
||||
movb $0x41, %ah
|
||||
int $0x18
|
||||
# Init graphic screen
|
||||
movb $0x42, %al
|
||||
movb $0xc0, %ch
|
||||
int $0x18
|
||||
# 80x25 mode
|
||||
movw $0x0a00, %ax
|
||||
int $0x18
|
||||
ret
|
||||
|
||||
#
|
||||
# Initialize CRT (hireso mode)
|
||||
#
|
||||
init_screen_hireso:
|
||||
# Init RAM window
|
||||
movb $8, %al
|
||||
outb %al, $0x91
|
||||
movb $0x0a, %al
|
||||
outb %al, $0x93
|
||||
# 80x31 mode
|
||||
movw $0x0a00, %ax
|
||||
int $0x18
|
||||
ret
|
||||
|
||||
#
|
||||
# Initialize screen (internal)
|
||||
#
|
||||
init_screen:
|
||||
movb ishireso, %ah
|
||||
orb %ah, %ah
|
||||
jne hireso_ini
|
||||
call init_screen_normal
|
||||
jmp init_next
|
||||
hireso_ini:
|
||||
call init_screen_hireso
|
||||
init_next:
|
||||
movb $0x0c, %ah
|
||||
int $0x18
|
||||
# cursor home and off
|
||||
xorw %dx, %dx
|
||||
movb $0x13, %ah
|
||||
int $0x18
|
||||
movb $0x12, %ah
|
||||
int $0x18
|
||||
ret
|
||||
|
||||
#
|
||||
# Initialize screeen
|
||||
#
|
||||
.global sc_init
|
||||
sc_init:
|
||||
call init_screen
|
||||
call sc_clean
|
||||
movw $0, curpos
|
||||
ret
|
||||
|
||||
.data
|
||||
curpos: .word 0 # Current cursor position
|
@ -1,19 +0,0 @@
|
||||
# $FreeBSD$
|
||||
|
||||
PROG= ${BOOT}
|
||||
INTERNALPROG=
|
||||
FILES= ${BOOT}
|
||||
MAN=
|
||||
SRCS= ${BOOT}.s
|
||||
CLEANFILES= ${BOOT}
|
||||
|
||||
BOOT= boot0
|
||||
|
||||
# The base address that we the boot0 code to to run it. Don't change this
|
||||
# unless you are glutton for punishment.
|
||||
BOOT_BOOT0_ORG?= 0x0000
|
||||
ORG=${BOOT_BOOT0_ORG}
|
||||
|
||||
LDFLAGS=${LDFLAGS_BIN}
|
||||
|
||||
.include <bsd.prog.mk>
|
@ -1,108 +0,0 @@
|
||||
# Copyright (c) KATO Takenori, 1999, 2000.
|
||||
#
|
||||
# All rights reserved. Unpublished rights reserved under the copyright
|
||||
# laws of Japan.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions
|
||||
# are met:
|
||||
#
|
||||
# 1. Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer as
|
||||
# the first lines of this file unmodified.
|
||||
# 2. Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# 3. The name of the author may not be used to endorse or promote products
|
||||
# derived from this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
||||
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
# $FreeBSD$
|
||||
|
||||
.globl start
|
||||
.code16
|
||||
start:
|
||||
jmp main
|
||||
|
||||
.org 4
|
||||
.ascii "IPL1"
|
||||
.byte 0, 0, 0
|
||||
|
||||
.globl start
|
||||
main:
|
||||
xor %ax, %ax
|
||||
mov %ax, %ds
|
||||
mov (0x584), %al # DA/UA
|
||||
mov %al, %ah
|
||||
and $0xf0, %ah
|
||||
cmp $0x90, %ah
|
||||
je fdd
|
||||
|
||||
# hdd
|
||||
mov $6, %ah
|
||||
mov $0x3000, %bx
|
||||
mov %bx, %es
|
||||
mov $0x2000, %bx
|
||||
xor %cx, %cx
|
||||
xor %dx, %dx
|
||||
xor %bp, %bp
|
||||
int $0x1b
|
||||
jc error_hdd
|
||||
|
||||
push %ax
|
||||
mov %es, %ax
|
||||
add $0x40, %ax
|
||||
mov %ax, %es
|
||||
pop %ax
|
||||
push %es
|
||||
push %bp
|
||||
lret
|
||||
|
||||
# fdd
|
||||
fdd:
|
||||
xor %di, %di
|
||||
fdd_retry:
|
||||
mov $0xd6, %ah
|
||||
mov $0x3000, %bx
|
||||
mov %bx, %es
|
||||
mov $0x2000, %bx
|
||||
mov $0x0200, %cx
|
||||
mov $0x0001, %dx
|
||||
xor %bp, %bp
|
||||
int $0x1b
|
||||
jc error
|
||||
push %ax
|
||||
mov %es, %ax
|
||||
add $0x40, %ax
|
||||
mov %ax, %es
|
||||
pop %ax
|
||||
push %es
|
||||
push %bp
|
||||
lret
|
||||
|
||||
error:
|
||||
or %di, %di
|
||||
jnz error_hdd
|
||||
and $0x0f, %al
|
||||
or $0x30, %al
|
||||
jmp fdd_retry
|
||||
|
||||
error_hdd:
|
||||
jmp error
|
||||
|
||||
.org 0x1fa
|
||||
.byte 0 # defflag_off
|
||||
.byte 0 # defpart_off
|
||||
.byte 1 # menu version
|
||||
.byte 0
|
||||
.word 0xaa55
|
@ -1,116 +0,0 @@
|
||||
# $FreeBSD$
|
||||
|
||||
.include <bsd.own.mk>
|
||||
|
||||
FILES= boot boot1 boot2
|
||||
|
||||
NM?= nm
|
||||
|
||||
BOOT_COMCONSOLE_PORT?= 0x238
|
||||
BOOT_COMCONSOLE_SPEED?= 9600
|
||||
B2SIOFMT?= 0x3
|
||||
|
||||
REL1= 0x700
|
||||
ORG1= 0
|
||||
ORG2= 0x2000
|
||||
|
||||
# Decide level of UFS support.
|
||||
BOOT2_UFS?= UFS1_AND_UFS2
|
||||
#BOOT2_UFS?= UFS2_ONLY
|
||||
#BOOT2_UFS?= UFS1_ONLY
|
||||
|
||||
CFLAGS= -fomit-frame-pointer \
|
||||
-mrtd \
|
||||
-mregparm=3 \
|
||||
-D${BOOT2_UFS} \
|
||||
-DFLAGS=${BOOT_BOOT1_FLAGS} \
|
||||
-DSIOPRT=${BOOT_COMCONSOLE_PORT} \
|
||||
-DSIOFMT=${B2SIOFMT} \
|
||||
-DSIOSPD=${BOOT_COMCONSOLE_SPEED} \
|
||||
-I${.CURDIR}/../../.. \
|
||||
-I${.CURDIR}/../../i386/boot2 \
|
||||
-I${.CURDIR}/../../common \
|
||||
-I${.CURDIR}/../btx/lib -I. \
|
||||
-Wall -Waggregate-return -Wbad-function-cast -Wcast-align \
|
||||
-Wmissing-declarations -Wmissing-prototypes -Wnested-externs \
|
||||
-Wpointer-arith -Wshadow -Wstrict-prototypes -Wwrite-strings \
|
||||
-Winline
|
||||
|
||||
CFLAGS.gcc+= -Os \
|
||||
-fno-guess-branch-probability \
|
||||
-fno-unit-at-a-time \
|
||||
--param max-inline-insns-single=100
|
||||
.if ${COMPILER_TYPE} == "gcc" && ${COMPILER_VERSION} <= 40201
|
||||
CFLAGS.gcc+= -mno-align-long-strings
|
||||
.endif
|
||||
|
||||
# Set machine type to PC98_SYSTEM_PARAMETER
|
||||
#CFLAGS+= -DSET_MACHINE_TYPE
|
||||
|
||||
# Initialize the bi_bios_geom using the BIOS geometry
|
||||
#CFLAGS+= -DGET_BIOSGEOM
|
||||
|
||||
CFLAGS.clang+= -Oz ${CLANG_OPT_SMALL}
|
||||
|
||||
LD_FLAGS=${LD_FLAGS_BIN}
|
||||
|
||||
# Pick up ../Makefile.inc early.
|
||||
.include <bsd.init.mk>
|
||||
|
||||
.PATH: ${.CURDIR}/../../i386/boot2
|
||||
|
||||
CLEANFILES= boot
|
||||
|
||||
boot: boot1 boot2
|
||||
cat boot1 boot2 > boot
|
||||
|
||||
CLEANFILES+= boot1 boot1.out boot1.o
|
||||
|
||||
boot1: boot1.out
|
||||
${OBJCOPY} -S -O binary boot1.out ${.TARGET}
|
||||
|
||||
boot1.out: boot1.o
|
||||
${LD} ${LD_FLAGS} -e start -Ttext ${ORG1} -o ${.TARGET} boot1.o
|
||||
|
||||
CLEANFILES+= boot2 boot2.ld boot2.ldr boot2.bin boot2.out boot2.o \
|
||||
boot2.s boot2.s.tmp boot2.h sio.o
|
||||
|
||||
boot2: boot2.ld
|
||||
@set -- `ls -l boot2.ld`; x=$$((7680-$$5)); \
|
||||
echo "$$x bytes available"; test $$x -ge 0
|
||||
${DD} if=boot2.ld of=${.TARGET} obs=7680 conv=osync
|
||||
|
||||
boot2.ld: boot2.ldr boot2.bin ${BTXKERN}
|
||||
btxld -v -E ${ORG2} -f bin -b ${BTXKERN} -l boot2.ldr \
|
||||
-o ${.TARGET} -P 1 boot2.bin
|
||||
|
||||
boot2.ldr:
|
||||
${DD} if=/dev/zero of=${.TARGET} bs=276 count=1
|
||||
|
||||
boot2.bin: boot2.out
|
||||
${OBJCOPY} -S -O binary boot2.out ${.TARGET}
|
||||
|
||||
boot2.out: ${BTXCRT} boot2.o sio.o
|
||||
${LD} ${LD_FLAGS} -Ttext ${ORG2} -o ${.TARGET} ${.ALLSRC}
|
||||
|
||||
boot2.o: boot2.s
|
||||
${CC} ${ACFLAGS} -c boot2.s
|
||||
|
||||
SRCS= boot2.c boot2.h
|
||||
|
||||
boot2.s: boot2.c boot2.h ${.CURDIR}/../../common/ufsread.c
|
||||
${CC} ${CFLAGS} -S -o boot2.s.tmp ${.CURDIR}/boot2.c
|
||||
sed -e '/align/d' -e '/nop/d' < boot2.s.tmp > boot2.s
|
||||
rm -f boot2.s.tmp
|
||||
|
||||
boot2.h: boot1.out
|
||||
${NM} -t d ${.ALLSRC} | awk '/([0-9])+ T (read|putc)/ \
|
||||
{ x = $$1 - ORG1; \
|
||||
printf("#define %sORG %#x\n", toupper($$3), REL1 + x) }' \
|
||||
ORG1=`printf "%d" ${ORG1}` \
|
||||
REL1=`printf "%d" ${REL1}` > ${.TARGET}
|
||||
|
||||
.include <bsd.prog.mk>
|
||||
|
||||
# XXX: clang integrated-as doesn't grok .codeNN directives yet
|
||||
CFLAGS.boot1.S= ${CLANG_NO_IAS}
|
@ -1,395 +0,0 @@
|
||||
/*-
|
||||
* Copyright (c) 2008-2009 TAKAHASHI Yoshihiro
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $FreeBSD$
|
||||
*/
|
||||
|
||||
/* Memory Locations */
|
||||
.set STACK_OFF,0x6000 # Stack offset
|
||||
.set LOAD_SIZE,8192 # Load size
|
||||
.set DAUA,0x0584 # DA/UA
|
||||
.set MEM_REL,0x700 # Relocation address
|
||||
.set MEM_ARG,0x900 # Arguments
|
||||
.set MEM_BUF,0x8cec # Load area
|
||||
.set MEM_BTX,0x9000 # BTX start
|
||||
.set MEM_JMP,0x9010 # BTX entry point
|
||||
.set MEM_USR,0xa000 # Client start
|
||||
|
||||
/* PC98 machine type from sys/pc98/pc98/pc98_machdep.h */
|
||||
.set MEM_SYS, 0xa100 # System common area segment
|
||||
.set PC98_MACHINE_TYPE, 0x0620 # PC98 machine type
|
||||
.set EPSON_ID, 0x0624 # EPSON machine id
|
||||
|
||||
.set M_NEC_PC98, 0x0001
|
||||
.set M_EPSON_PC98, 0x0002
|
||||
.set M_NOT_H98, 0x0010
|
||||
.set M_H98, 0x0020
|
||||
.set M_NOTE, 0x0040
|
||||
.set M_NORMAL, 0x1000
|
||||
.set M_8M, 0x8000
|
||||
|
||||
/* Partition Constants */
|
||||
.set PRT_OFF,0x1be # Partition offset
|
||||
|
||||
/* Misc. Constants */
|
||||
.set SIZ_PAG,0x1000 # Page size
|
||||
.set SIZ_SEC,0x200 # Sector size
|
||||
|
||||
.set NSECT,0x10
|
||||
|
||||
.globl start
|
||||
.globl read
|
||||
.globl putc
|
||||
.code16
|
||||
|
||||
start: jmp main
|
||||
|
||||
boot_cyl: .org 4
|
||||
.ascii "IPL1 "
|
||||
|
||||
main: cld
|
||||
|
||||
/* Setup the stack */
|
||||
xor %si,%si
|
||||
mov %si,%ss
|
||||
mov $STACK_OFF,%sp
|
||||
|
||||
push %cx
|
||||
|
||||
/* Relocate ourself to MEM_REL */
|
||||
push %cs
|
||||
pop %ds
|
||||
mov %si,%es
|
||||
mov $MEM_REL,%di
|
||||
mov $SIZ_SEC,%cx
|
||||
rep
|
||||
movsb
|
||||
|
||||
/* Transfer PC-9801 system common area */
|
||||
xor %ax,%ax
|
||||
mov %ax,%si
|
||||
mov %ax,%ds
|
||||
mov %ax,%di
|
||||
mov $MEM_SYS,%ax
|
||||
mov %ax,%es
|
||||
mov $0x0600,%cx
|
||||
rep
|
||||
movsb
|
||||
|
||||
/* Transfer EPSON machine type */
|
||||
mov $0xfd00,%ax
|
||||
mov %ax,%ds
|
||||
mov (0x804),%eax
|
||||
and $0x00ffffff,%eax
|
||||
mov %eax,%es:(EPSON_ID)
|
||||
|
||||
/* Set machine type to PC98_SYSTEM_PARAMETER */
|
||||
#ifdef SET_MACHINE_TYPE
|
||||
call set_machine_type
|
||||
#else
|
||||
mov $M_NEC_PC98+M_NOT_H98,%eax
|
||||
mov %eax,%es:(PC98_MACHINE_TYPE)
|
||||
#endif
|
||||
|
||||
/* Setup graphic screen */
|
||||
mov $0x42,%ah /* 640x400 */
|
||||
mov $0xc0,%ch
|
||||
int $0x18
|
||||
mov $0x40,%ah /* graph on */
|
||||
int $0x18
|
||||
|
||||
/* Setup text screen */
|
||||
mov $0x0a00,%ax /* 80x25 */
|
||||
int $0x18
|
||||
mov $0x0c,%ah /* text on */
|
||||
int $0x18
|
||||
mov $0x13,%ah /* cursor home */
|
||||
xor %dx,%dx
|
||||
int $0x18
|
||||
mov $0x11,%ah /* cursor on */
|
||||
int $0x18
|
||||
|
||||
/* Setup keyboard */
|
||||
mov $0x03,%ah
|
||||
int $0x18
|
||||
|
||||
pop %cx
|
||||
|
||||
/* bootstrap passes */
|
||||
xor %edi,%edi
|
||||
mov %di,%ds
|
||||
mov %di,%es
|
||||
mov %cs,%bx
|
||||
cmp $0x1fe0,%bx
|
||||
jz boot_fd
|
||||
cmp $0x1fc0,%bx
|
||||
jnz boot_hd
|
||||
xor %cx,%cx
|
||||
mov (DAUA),%al
|
||||
and $0xf0,%al
|
||||
cmp $0x30,%al
|
||||
jz boot_fd
|
||||
cmp $0x90,%al
|
||||
jnz boot_hd
|
||||
boot_fd: xor %cx,%cx
|
||||
jmp boot_load
|
||||
boot_hd: test %cx,%cx
|
||||
jnz boot_load
|
||||
mov %cs:(boot_cyl),%cx
|
||||
boot_load: mov %cx,MEM_ARG /* Save cylinder number */
|
||||
mov %cx,%di
|
||||
xor %dx,%dx
|
||||
mov $LOAD_SIZE,%bx
|
||||
mov $MEM_BUF,%bp
|
||||
push %cs
|
||||
callw read
|
||||
jc error
|
||||
|
||||
/* Transfer boot2.bin */
|
||||
mov $MEM_BTX,%bx
|
||||
mov 0xa(%bx),%si /* BTX size */
|
||||
add %bx,%si /* start of boot2.bin */
|
||||
mov $MEM_USR+SIZ_PAG*2,%di
|
||||
mov $MEM_BTX+(NSECT-1)*SIZ_SEC,%cx
|
||||
sub %si,%cx
|
||||
rep
|
||||
movsb
|
||||
|
||||
/* Enable A20 */
|
||||
xor %ax,%ax
|
||||
outb %al,$0xf2
|
||||
mov $0x02,%al
|
||||
outb %al,$0xf6
|
||||
|
||||
/* Start BTX */
|
||||
ljmp $0x0000,$MEM_JMP
|
||||
|
||||
/*
|
||||
* Reads sectors from the disk.
|
||||
* Call with:
|
||||
*
|
||||
* %bx - bytes to read
|
||||
* %cx - cylinder
|
||||
* %dh - head
|
||||
* %dl - sector
|
||||
* %edi - lba
|
||||
* %es:(%bp) - buffer to read data into
|
||||
*/
|
||||
read: xor %ax,%ax
|
||||
mov %ax,%ds
|
||||
mov $0x06,%ah
|
||||
mov (DAUA),%al
|
||||
mov %ax,%si
|
||||
and $0xf0,%al
|
||||
cmp $0x30,%al /* 1.44MB FDD */
|
||||
jz read_fd
|
||||
cmp $0x90,%al /* 1MB FDD */
|
||||
jz read_fd
|
||||
cmp $0xa0,%al /* Is SCSI device? */
|
||||
jnz read_load
|
||||
push %cx
|
||||
mov %si,%cx
|
||||
and $0x0f,%cl
|
||||
inc %cl
|
||||
mov (0x482),%ah
|
||||
shr %cl,%ah /* Is SCSI HDD? */
|
||||
pop %cx
|
||||
jc read_load
|
||||
and $0xff7f,%si /* SCSI MO */
|
||||
mov %di,%cx
|
||||
shr $16,%edi
|
||||
mov %di,%dx
|
||||
jmp read_load
|
||||
read_fd: or $0xd000,%si
|
||||
or $0x0200,%cx
|
||||
inc %dx
|
||||
read_load: mov %si,%ax
|
||||
int $0x1b
|
||||
lret
|
||||
|
||||
/*
|
||||
* Print out the error message, wait for a keypress, and then reboot
|
||||
* the machine.
|
||||
*/
|
||||
error: push %cs
|
||||
pop %ds
|
||||
mov $msg_eread,%si
|
||||
call putstr
|
||||
xor %ax,%ax /* Get keypress */
|
||||
int $0x18
|
||||
xor %ax,%ax /* CPU reset */
|
||||
outb %al,$0xf0
|
||||
halt: hlt
|
||||
jmp halt /* Spin */
|
||||
|
||||
/*
|
||||
* Display a null-terminated string.
|
||||
*/
|
||||
putstr.0: push %cs
|
||||
callw putc
|
||||
putstr: lodsb
|
||||
test %al,%al
|
||||
jne putstr.0
|
||||
ret
|
||||
|
||||
/*
|
||||
* Display a single char.
|
||||
*/
|
||||
putc: pusha
|
||||
xor %dx,%dx
|
||||
mov %dx,%ds
|
||||
mov MEM_REL+cursor-start,%di
|
||||
mov $0xa000,%bx
|
||||
mov %bx,%es
|
||||
mov $(80*2),%cx
|
||||
|
||||
cmp $0x08,%al
|
||||
je putc.bs
|
||||
cmp $0x0d,%al
|
||||
je putc.cr
|
||||
cmp $0x0a,%al
|
||||
je putc.lf
|
||||
cmp $0x5c,%al /* \ */
|
||||
jne 1f
|
||||
mov $0xfc,%al
|
||||
1: movb $0xe1,%es:0x2000(%di)
|
||||
stosw
|
||||
jmp putc.scr
|
||||
putc.bs: test %di,%di
|
||||
jz putc.move
|
||||
dec %di
|
||||
dec %di
|
||||
movb $0xe1,%es:0x2000(%di)
|
||||
movw $0x20,%es:(%di)
|
||||
jmp putc.move
|
||||
putc.cr: mov %di,%ax
|
||||
div %cx
|
||||
sub %dx,%di
|
||||
jmp putc.move
|
||||
putc.lf: add %cx,%di
|
||||
putc.scr: cmp $(80*2*25),%di /* Scroll screen */
|
||||
jb putc.move
|
||||
push %ds
|
||||
mov %bx,%ds
|
||||
mov $(80*2),%si
|
||||
xor %di,%di
|
||||
mov $(80*24/2),%cx
|
||||
rep
|
||||
movsl
|
||||
xor %ax,%ax
|
||||
mov $0x20,%al
|
||||
mov $80,%cl
|
||||
rep
|
||||
stosw
|
||||
pop %ds
|
||||
mov $(80*24*2),%di
|
||||
putc.move: mov %di,MEM_REL+cursor-start /* Move cursor */
|
||||
mov $0x13,%ah
|
||||
mov %di,%dx
|
||||
int $0x18
|
||||
popa
|
||||
lret
|
||||
|
||||
cursor: .word 0
|
||||
|
||||
#ifdef SET_MACHINE_TYPE
|
||||
/*
|
||||
* Set machine type to PC98_SYSTEM_PARAMETER.
|
||||
*/
|
||||
set_machine_type:
|
||||
xor %edx,%edx
|
||||
mov %dx,%ds
|
||||
// mov $MEM_SYS,%ax
|
||||
// mov %ax,%es
|
||||
|
||||
/* Wait V-SYNC */
|
||||
vsync.1: inb $0x60,%al
|
||||
test $0x20,%al
|
||||
jnz vsync.1
|
||||
vsync.2: inb $0x60,%al
|
||||
test $0x20,%al
|
||||
jz vsync.2
|
||||
|
||||
/* ANK 'A' font */
|
||||
xor %al,%al
|
||||
outb %al,$0xa1
|
||||
mov $0x41,%al
|
||||
outb %al,$0xa3
|
||||
|
||||
/* Get 'A' font from CG window */
|
||||
push %ds
|
||||
mov $0xa400,%ax
|
||||
mov %ax,%ds
|
||||
xor %eax,%eax
|
||||
xor %bx,%bx
|
||||
mov $4,%cx
|
||||
font.1: add (%bx),%eax
|
||||
add $4,%bx
|
||||
loop font.1
|
||||
pop %ds
|
||||
cmp $0x6efc58fc,%eax
|
||||
jnz m_epson
|
||||
|
||||
m_pc98: or $M_NEC_PC98,%edx
|
||||
mov $0x0458,%bx
|
||||
mov (%bx),%al
|
||||
test $0x80,%al
|
||||
jz m_not_h98
|
||||
or $M_H98,%edx
|
||||
jmp 1f
|
||||
m_epson: or $M_EPSON_PC98,%edx
|
||||
m_not_h98: or $M_NOT_H98,%edx
|
||||
|
||||
1: inb $0x42,%al
|
||||
test $0x20,%al
|
||||
jz 1f
|
||||
or $M_8M,%edx
|
||||
|
||||
1: mov $0x0400,%bx
|
||||
mov (%bx),%al
|
||||
test $0x80,%al
|
||||
jz 1f
|
||||
or $M_NOTE,%edx
|
||||
|
||||
1: mov $PC98_MACHINE_TYPE,%bx
|
||||
mov %edx,%es:(%bx)
|
||||
ret
|
||||
#endif
|
||||
|
||||
/* Messages */
|
||||
|
||||
msg_eread: .asciz "Error\r\n"
|
||||
|
||||
.org PRT_OFF,0x90
|
||||
|
||||
/* Partition table */
|
||||
|
||||
.fill 0x30,0x1,0x0
|
||||
.byte 0x80, 0x00, 0x01, 0x00
|
||||
.byte 0xa5, 0xff, 0xff, 0xff
|
||||
.byte 0x00, 0x00, 0x00, 0x00
|
||||
.byte 0x50, 0xc3, 0x00, 0x00
|
||||
|
||||
.word 0xaa55 # Magic number
|
@ -1,803 +0,0 @@
|
||||
/*-
|
||||
* Copyright (c) 2008-2009 TAKAHASHI Yoshihiro
|
||||
* Copyright (c) 1998 Robert Nordier
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms are freely
|
||||
* permitted provided that the above copyright notice and this
|
||||
* paragraph and the following disclaimer are duplicated in all
|
||||
* such forms.
|
||||
*
|
||||
* This software is provided "AS IS" and without any express or
|
||||
* implied warranties, including, without limitation, the implied
|
||||
* warranties of merchantability and fitness for a particular
|
||||
* purpose.
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__FBSDID("$FreeBSD$");
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/disklabel.h>
|
||||
#include <sys/diskpc98.h>
|
||||
#include <sys/dirent.h>
|
||||
#include <sys/reboot.h>
|
||||
|
||||
#include <machine/bootinfo.h>
|
||||
#include <machine/cpufunc.h>
|
||||
#include <machine/elf.h>
|
||||
|
||||
#include <stdarg.h>
|
||||
|
||||
#include <a.out.h>
|
||||
|
||||
#include <btxv86.h>
|
||||
|
||||
#include "boot2.h"
|
||||
#include "lib.h"
|
||||
#include "paths.h"
|
||||
#include "rbx.h"
|
||||
|
||||
/* Define to 0 to omit serial support */
|
||||
#ifndef SERIAL
|
||||
#define SERIAL 0
|
||||
#endif
|
||||
|
||||
#define IO_KEYBOARD 1
|
||||
#define IO_SERIAL 2
|
||||
|
||||
#if SERIAL
|
||||
#define DO_KBD (ioctrl & IO_KEYBOARD)
|
||||
#define DO_SIO (ioctrl & IO_SERIAL)
|
||||
#else
|
||||
#define DO_KBD (1)
|
||||
#define DO_SIO (0)
|
||||
#endif
|
||||
|
||||
#define SECOND 1 /* Circa that many ticks in a second. */
|
||||
|
||||
#define ARGS 0x900
|
||||
#define NOPT 14
|
||||
#define NDEV 3
|
||||
|
||||
#define DRV_DISK 0xf0
|
||||
#define DRV_UNIT 0x0f
|
||||
|
||||
#define TYPE_AD 0
|
||||
#define TYPE_DA 1
|
||||
#define TYPE_FD 2
|
||||
|
||||
extern uint32_t _end;
|
||||
|
||||
static const char optstr[NOPT] = "DhaCcdgmnpqrsv"; /* Also 'P', 'S' */
|
||||
static const unsigned char flags[NOPT] = {
|
||||
RBX_DUAL,
|
||||
RBX_SERIAL,
|
||||
RBX_ASKNAME,
|
||||
RBX_CDROM,
|
||||
RBX_CONFIG,
|
||||
RBX_KDB,
|
||||
RBX_GDB,
|
||||
RBX_MUTE,
|
||||
RBX_NOINTR,
|
||||
RBX_PAUSE,
|
||||
RBX_QUIET,
|
||||
RBX_DFLTROOT,
|
||||
RBX_SINGLE,
|
||||
RBX_VERBOSE
|
||||
};
|
||||
|
||||
static const char *const dev_nm[NDEV] = {"ad", "da", "fd"};
|
||||
static const unsigned char dev_maj[NDEV] = {30, 4, 2};
|
||||
static const unsigned char dev_daua[NDEV] = {0x80, 0xa0, 0x90};
|
||||
|
||||
static struct dsk {
|
||||
unsigned daua;
|
||||
unsigned type;
|
||||
unsigned disk;
|
||||
unsigned unit;
|
||||
unsigned head;
|
||||
unsigned sec;
|
||||
uint8_t slice;
|
||||
uint8_t part;
|
||||
unsigned start;
|
||||
} dsk;
|
||||
static char cmd[512], cmddup[512], knamebuf[1024];
|
||||
static const char *kname;
|
||||
uint32_t opts;
|
||||
static struct bootinfo bootinfo;
|
||||
#if SERIAL
|
||||
static int comspeed = SIOSPD;
|
||||
static uint8_t ioctrl = IO_KEYBOARD;
|
||||
#endif
|
||||
|
||||
int main(void);
|
||||
void exit(int);
|
||||
static void load(void);
|
||||
static int parse(void);
|
||||
static int dskread(void *, unsigned, unsigned);
|
||||
static void printf(const char *,...);
|
||||
static void putchar(int);
|
||||
static int drvread(void *, unsigned);
|
||||
static int keyhit(unsigned);
|
||||
static int xputc(int);
|
||||
static int xgetc(int);
|
||||
static inline int getc(int);
|
||||
|
||||
static void memcpy(void *, const void *, int);
|
||||
static void
|
||||
memcpy(void *dst, const void *src, int len)
|
||||
{
|
||||
const char *s = src;
|
||||
char *d = dst;
|
||||
|
||||
while (len--)
|
||||
*d++ = *s++;
|
||||
}
|
||||
|
||||
static inline int
|
||||
strcmp(const char *s1, const char *s2)
|
||||
{
|
||||
for (; *s1 == *s2 && *s1; s1++, s2++);
|
||||
return (unsigned char)*s1 - (unsigned char)*s2;
|
||||
}
|
||||
|
||||
#define UFS_SMALL_CGBASE
|
||||
#include "ufsread.c"
|
||||
|
||||
static inline int
|
||||
xfsread(ufs_ino_t inode, void *buf, size_t nbyte)
|
||||
{
|
||||
if ((size_t)fsread(inode, buf, nbyte) != nbyte) {
|
||||
printf("Invalid %s\n", "format");
|
||||
return -1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline void
|
||||
getstr(void)
|
||||
{
|
||||
char *s;
|
||||
int c;
|
||||
|
||||
s = cmd;
|
||||
for (;;) {
|
||||
switch (c = xgetc(0)) {
|
||||
case 0:
|
||||
break;
|
||||
case '\177':
|
||||
case '\b':
|
||||
if (s > cmd) {
|
||||
s--;
|
||||
printf("\b \b");
|
||||
}
|
||||
break;
|
||||
case '\n':
|
||||
case '\r':
|
||||
*s = 0;
|
||||
return;
|
||||
default:
|
||||
if (s - cmd < sizeof(cmd) - 1)
|
||||
*s++ = c;
|
||||
putchar(c);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static inline void
|
||||
putc(int c)
|
||||
{
|
||||
|
||||
v86.ctl = V86_ADDR | V86_CALLF | V86_FLAGS;
|
||||
v86.addr = PUTCORG; /* call to putc in boot1 */
|
||||
v86.eax = c;
|
||||
v86int();
|
||||
v86.ctl = V86_FLAGS;
|
||||
}
|
||||
|
||||
static inline int
|
||||
is_scsi_hd(void)
|
||||
{
|
||||
|
||||
if ((*(u_char *)PTOV(0x482) >> dsk.unit) & 0x01)
|
||||
return 1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline void
|
||||
fix_sector_size(void)
|
||||
{
|
||||
u_char *p;
|
||||
|
||||
p = (u_char *)PTOV(0x460 + dsk.unit * 4); /* SCSI equipment parameter */
|
||||
|
||||
if ((p[0] & 0x1f) == 7) { /* SCSI MO */
|
||||
if (!(p[3] & 0x30)) { /* 256B / sector */
|
||||
p[3] |= 0x10; /* forced set 512B / sector */
|
||||
p[3 + 0xa1000] |= 0x10;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static inline uint32_t
|
||||
get_diskinfo(void)
|
||||
{
|
||||
|
||||
if (dsk.disk == 0x30) { /* 1440KB FD */
|
||||
/* 80 cylinders, 2 heads, 18 sectors */
|
||||
return (80 << 16) | (2 << 8) | 18;
|
||||
} else if (dsk.disk == 0x90) { /* 1200KB FD */
|
||||
/* 80 cylinders, 2 heads, 15 sectors */
|
||||
return (80 << 16) | (2 << 8) | 15;
|
||||
} else if (dsk.disk == 0x80 || is_scsi_hd()) { /* IDE or SCSI HDD */
|
||||
v86.addr = 0x1b;
|
||||
v86.eax = 0x8400 | dsk.daua;
|
||||
v86int();
|
||||
return (v86.ecx << 16) | v86.edx;
|
||||
}
|
||||
|
||||
/* SCSI MO or CD */
|
||||
fix_sector_size(); /* SCSI MO */
|
||||
|
||||
/* other SCSI devices */
|
||||
return (65535 << 16) | (8 << 8) | 32;
|
||||
}
|
||||
|
||||
static void
|
||||
set_dsk(void)
|
||||
{
|
||||
uint32_t di;
|
||||
|
||||
di = get_diskinfo();
|
||||
|
||||
dsk.head = (di >> 8) & 0xff;
|
||||
dsk.sec = di & 0xff;
|
||||
dsk.start = 0;
|
||||
}
|
||||
|
||||
#ifdef GET_BIOSGEOM
|
||||
static uint32_t
|
||||
bd_getbigeom(int bunit)
|
||||
{
|
||||
int hds = 0;
|
||||
int unit = 0x80; /* IDE HDD */
|
||||
u_int addr = 0x55d;
|
||||
|
||||
while (unit < 0xa7) {
|
||||
if (*(u_char *)PTOV(addr) & (1 << (unit & 0x0f)))
|
||||
if (hds++ == bunit)
|
||||
break;
|
||||
|
||||
if (unit >= 0xA0) {
|
||||
int media = ((unsigned *)PTOV(0x460))[unit & 0x0F] & 0x1F;
|
||||
|
||||
if (media == 7 && hds++ == bunit) /* SCSI MO */
|
||||
return(0xFFFE0820); /* C:65535 H:8 S:32 */
|
||||
}
|
||||
if (++unit == 0x84) {
|
||||
unit = 0xA0; /* SCSI HDD */
|
||||
addr = 0x482;
|
||||
}
|
||||
}
|
||||
if (unit == 0xa7)
|
||||
return 0x4F020F; /* 1200KB FD C:80 H:2 S:15 */
|
||||
v86.addr = 0x1b;
|
||||
v86.eax = 0x8400 | unit;
|
||||
v86int();
|
||||
if (V86_CY(v86.efl))
|
||||
return 0x4F020F; /* 1200KB FD C:80 H:2 S:15 */
|
||||
return ((v86.ecx & 0xffff) << 16) | (v86.edx & 0xffff);
|
||||
}
|
||||
#endif
|
||||
|
||||
static int
|
||||
check_slice(void)
|
||||
{
|
||||
struct pc98_partition *dp;
|
||||
char *sec;
|
||||
unsigned i, cyl;
|
||||
|
||||
sec = dmadat->secbuf;
|
||||
cyl = *(uint16_t *)PTOV(ARGS);
|
||||
set_dsk();
|
||||
|
||||
if (dsk.type == TYPE_FD)
|
||||
return (WHOLE_DISK_SLICE);
|
||||
if (drvread(sec, PC98_BBSECTOR))
|
||||
return (WHOLE_DISK_SLICE); /* Read error */
|
||||
dp = (void *)(sec + PC98_PARTOFF);
|
||||
for (i = 0; i < PC98_NPARTS; i++) {
|
||||
if (dp[i].dp_mid == DOSMID_386BSD) {
|
||||
if (dp[i].dp_scyl <= cyl && cyl <= dp[i].dp_ecyl)
|
||||
return (BASE_SLICE + i);
|
||||
}
|
||||
}
|
||||
|
||||
return (WHOLE_DISK_SLICE);
|
||||
}
|
||||
|
||||
int
|
||||
main(void)
|
||||
{
|
||||
#ifdef GET_BIOSGEOM
|
||||
int i;
|
||||
#endif
|
||||
uint8_t autoboot;
|
||||
ufs_ino_t ino;
|
||||
size_t nbyte;
|
||||
|
||||
dmadat = (void *)(roundup2(__base + (int32_t)&_end, 0x10000) - __base);
|
||||
v86.ctl = V86_FLAGS;
|
||||
v86.efl = PSL_RESERVED_DEFAULT | PSL_I;
|
||||
dsk.daua = *(uint8_t *)PTOV(0x584);
|
||||
dsk.disk = dsk.daua & DRV_DISK;
|
||||
dsk.unit = dsk.daua & DRV_UNIT;
|
||||
if (dsk.disk == 0x80)
|
||||
dsk.type = TYPE_AD;
|
||||
else if (dsk.disk == 0xa0)
|
||||
dsk.type = TYPE_DA;
|
||||
else /* if (dsk.disk == 0x30 || dsk.disk == 0x90) */
|
||||
dsk.type = TYPE_FD;
|
||||
dsk.slice = check_slice();
|
||||
#ifdef GET_BIOSGEOM
|
||||
for (i = 0; i < N_BIOS_GEOM; i++)
|
||||
bootinfo.bi_bios_geom[i] = bd_getbigeom(i);
|
||||
#endif
|
||||
bootinfo.bi_version = BOOTINFO_VERSION;
|
||||
bootinfo.bi_size = sizeof(bootinfo);
|
||||
|
||||
/* Process configuration file */
|
||||
|
||||
autoboot = 1;
|
||||
|
||||
if ((ino = lookup(PATH_CONFIG)) ||
|
||||
(ino = lookup(PATH_DOTCONFIG))) {
|
||||
nbyte = fsread(ino, cmd, sizeof(cmd) - 1);
|
||||
cmd[nbyte] = '\0';
|
||||
}
|
||||
|
||||
if (*cmd) {
|
||||
memcpy(cmddup, cmd, sizeof(cmd));
|
||||
if (parse())
|
||||
autoboot = 0;
|
||||
if (!OPT_CHECK(RBX_QUIET))
|
||||
printf("%s: %s", PATH_CONFIG, cmddup);
|
||||
/* Do not process this command twice */
|
||||
*cmd = 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* Try to exec stage 3 boot loader. If interrupted by a keypress,
|
||||
* or in case of failure, try to load a kernel directly instead.
|
||||
*/
|
||||
|
||||
if (!kname) {
|
||||
kname = PATH_LOADER;
|
||||
if (autoboot && !keyhit(3*SECOND)) {
|
||||
load();
|
||||
kname = PATH_KERNEL;
|
||||
}
|
||||
}
|
||||
|
||||
/* Present the user with the boot2 prompt. */
|
||||
|
||||
for (;;) {
|
||||
if (!autoboot || !OPT_CHECK(RBX_QUIET))
|
||||
printf("\nFreeBSD/pc98 boot\n"
|
||||
"Default: %u:%s(%u,%c)%s\n"
|
||||
"boot: ",
|
||||
dsk.unit, dev_nm[dsk.type], dsk.unit,
|
||||
'a' + dsk.part, kname);
|
||||
if (DO_SIO)
|
||||
sio_flush();
|
||||
if (!autoboot || keyhit(3*SECOND))
|
||||
getstr();
|
||||
else if (!autoboot || !OPT_CHECK(RBX_QUIET))
|
||||
putchar('\n');
|
||||
autoboot = 0;
|
||||
if (parse())
|
||||
putchar('\a');
|
||||
else
|
||||
load();
|
||||
}
|
||||
}
|
||||
|
||||
/* XXX - Needed for btxld to link the boot2 binary; do not remove. */
|
||||
void
|
||||
exit(int x)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
load(void)
|
||||
{
|
||||
union {
|
||||
struct exec ex;
|
||||
Elf32_Ehdr eh;
|
||||
} hdr;
|
||||
static Elf32_Phdr ep[2];
|
||||
static Elf32_Shdr es[2];
|
||||
caddr_t p;
|
||||
ufs_ino_t ino;
|
||||
uint32_t addr;
|
||||
int k;
|
||||
uint8_t i, j;
|
||||
|
||||
if (!(ino = lookup(kname))) {
|
||||
if (!ls)
|
||||
printf("No %s\n", kname);
|
||||
return;
|
||||
}
|
||||
if (xfsread(ino, &hdr, sizeof(hdr)))
|
||||
return;
|
||||
|
||||
if (N_GETMAGIC(hdr.ex) == ZMAGIC) {
|
||||
addr = hdr.ex.a_entry & 0xffffff;
|
||||
p = PTOV(addr);
|
||||
fs_off = PAGE_SIZE;
|
||||
if (xfsread(ino, p, hdr.ex.a_text))
|
||||
return;
|
||||
p += roundup2(hdr.ex.a_text, PAGE_SIZE);
|
||||
if (xfsread(ino, p, hdr.ex.a_data))
|
||||
return;
|
||||
} else if (IS_ELF(hdr.eh)) {
|
||||
fs_off = hdr.eh.e_phoff;
|
||||
for (j = k = 0; k < hdr.eh.e_phnum && j < 2; k++) {
|
||||
if (xfsread(ino, ep + j, sizeof(ep[0])))
|
||||
return;
|
||||
if (ep[j].p_type == PT_LOAD)
|
||||
j++;
|
||||
}
|
||||
for (i = 0; i < 2; i++) {
|
||||
p = PTOV(ep[i].p_paddr & 0xffffff);
|
||||
fs_off = ep[i].p_offset;
|
||||
if (xfsread(ino, p, ep[i].p_filesz))
|
||||
return;
|
||||
}
|
||||
p += roundup2(ep[1].p_memsz, PAGE_SIZE);
|
||||
bootinfo.bi_symtab = VTOP(p);
|
||||
if (hdr.eh.e_shnum == hdr.eh.e_shstrndx + 3) {
|
||||
fs_off = hdr.eh.e_shoff + sizeof(es[0]) *
|
||||
(hdr.eh.e_shstrndx + 1);
|
||||
if (xfsread(ino, &es, sizeof(es)))
|
||||
return;
|
||||
for (i = 0; i < 2; i++) {
|
||||
*(Elf32_Word *)p = es[i].sh_size;
|
||||
p += sizeof(es[i].sh_size);
|
||||
fs_off = es[i].sh_offset;
|
||||
if (xfsread(ino, p, es[i].sh_size))
|
||||
return;
|
||||
p += es[i].sh_size;
|
||||
}
|
||||
}
|
||||
addr = hdr.eh.e_entry & 0xffffff;
|
||||
bootinfo.bi_esymtab = VTOP(p);
|
||||
} else {
|
||||
printf("Invalid %s\n", "format");
|
||||
return;
|
||||
}
|
||||
|
||||
bootinfo.bi_kernelname = VTOP(kname);
|
||||
bootinfo.bi_bios_dev = dsk.daua;
|
||||
__exec((caddr_t)addr, RB_BOOTINFO | (opts & RBX_MASK),
|
||||
MAKEBOOTDEV(dev_maj[dsk.type], dsk.slice, dsk.unit, dsk.part),
|
||||
0, 0, 0, VTOP(&bootinfo));
|
||||
}
|
||||
|
||||
static int
|
||||
parse()
|
||||
{
|
||||
char *arg = cmd;
|
||||
char *ep, *p, *q;
|
||||
const char *cp;
|
||||
unsigned int drv;
|
||||
int c, i, j;
|
||||
size_t k;
|
||||
|
||||
while ((c = *arg++)) {
|
||||
if (c == ' ' || c == '\t' || c == '\n')
|
||||
continue;
|
||||
for (p = arg; *p && *p != '\n' && *p != ' ' && *p != '\t'; p++);
|
||||
ep = p;
|
||||
if (*p)
|
||||
*p++ = 0;
|
||||
if (c == '-') {
|
||||
while ((c = *arg++)) {
|
||||
if (c == 'P') {
|
||||
if (*(uint8_t *)PTOV(0x481) & 0x48) {
|
||||
cp = "yes";
|
||||
} else {
|
||||
opts |= OPT_SET(RBX_DUAL) | OPT_SET(RBX_SERIAL);
|
||||
cp = "no";
|
||||
}
|
||||
printf("Keyboard: %s\n", cp);
|
||||
continue;
|
||||
#if SERIAL
|
||||
} else if (c == 'S') {
|
||||
j = 0;
|
||||
while ((unsigned int)(i = *arg++ - '0') <= 9)
|
||||
j = j * 10 + i;
|
||||
if (j > 0 && i == -'0') {
|
||||
comspeed = j;
|
||||
break;
|
||||
}
|
||||
/* Fall through to error below ('S' not in optstr[]). */
|
||||
#endif
|
||||
}
|
||||
for (i = 0; c != optstr[i]; i++)
|
||||
if (i == NOPT - 1)
|
||||
return -1;
|
||||
opts ^= OPT_SET(flags[i]);
|
||||
}
|
||||
#if SERIAL
|
||||
ioctrl = OPT_CHECK(RBX_DUAL) ? (IO_SERIAL|IO_KEYBOARD) :
|
||||
OPT_CHECK(RBX_SERIAL) ? IO_SERIAL : IO_KEYBOARD;
|
||||
if (DO_SIO) {
|
||||
if (sio_init(115200 / comspeed) != 0)
|
||||
ioctrl &= ~IO_SERIAL;
|
||||
}
|
||||
#endif
|
||||
} else {
|
||||
for (q = arg--; *q && *q != '('; q++);
|
||||
if (*q) {
|
||||
drv = -1;
|
||||
if (arg[1] == ':') {
|
||||
drv = *arg - '0';
|
||||
if (drv > 9)
|
||||
return (-1);
|
||||
arg += 2;
|
||||
}
|
||||
if (q - arg != 2)
|
||||
return -1;
|
||||
for (i = 0; arg[0] != dev_nm[i][0] ||
|
||||
arg[1] != dev_nm[i][1]; i++)
|
||||
if (i == NDEV - 1)
|
||||
return -1;
|
||||
dsk.type = i;
|
||||
arg += 3;
|
||||
dsk.unit = *arg - '0';
|
||||
if (arg[1] != ',' || dsk.unit > 9)
|
||||
return -1;
|
||||
arg += 2;
|
||||
dsk.slice = WHOLE_DISK_SLICE;
|
||||
if (arg[1] == ',') {
|
||||
dsk.slice = *arg - '0' + 1;
|
||||
if (dsk.slice > PC98_NPARTS + 1)
|
||||
return -1;
|
||||
arg += 2;
|
||||
}
|
||||
if (arg[1] != ')')
|
||||
return -1;
|
||||
dsk.part = *arg - 'a';
|
||||
if (dsk.part > 7)
|
||||
return (-1);
|
||||
arg += 2;
|
||||
if (drv == -1)
|
||||
drv = dsk.unit;
|
||||
dsk.disk = dev_daua[dsk.type];
|
||||
dsk.daua = dsk.disk | dsk.unit;
|
||||
dsk_meta = 0;
|
||||
}
|
||||
k = ep - arg;
|
||||
if (k > 0) {
|
||||
if (k >= sizeof(knamebuf))
|
||||
return -1;
|
||||
memcpy(knamebuf, arg, k + 1);
|
||||
kname = knamebuf;
|
||||
}
|
||||
}
|
||||
arg = p;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
dskread(void *buf, unsigned lba, unsigned nblk)
|
||||
{
|
||||
struct pc98_partition *dp;
|
||||
struct disklabel *d;
|
||||
char *sec;
|
||||
unsigned i;
|
||||
uint8_t sl;
|
||||
u_char *p;
|
||||
const char *reason;
|
||||
|
||||
if (!dsk_meta) {
|
||||
sec = dmadat->secbuf;
|
||||
set_dsk();
|
||||
if (dsk.type == TYPE_FD)
|
||||
goto unsliced;
|
||||
if (drvread(sec, PC98_BBSECTOR))
|
||||
return -1;
|
||||
dp = (void *)(sec + PC98_PARTOFF);
|
||||
sl = dsk.slice;
|
||||
if (sl < BASE_SLICE) {
|
||||
for (i = 0; i < PC98_NPARTS; i++)
|
||||
if (dp[i].dp_mid == DOSMID_386BSD) {
|
||||
sl = BASE_SLICE + i;
|
||||
break;
|
||||
}
|
||||
dsk.slice = sl;
|
||||
}
|
||||
if (sl != WHOLE_DISK_SLICE) {
|
||||
dp += sl - BASE_SLICE;
|
||||
if (dp->dp_mid != DOSMID_386BSD) {
|
||||
reason = "slice";
|
||||
goto error;
|
||||
}
|
||||
dsk.start = dp->dp_scyl * dsk.head * dsk.sec +
|
||||
dp->dp_shd * dsk.sec + dp->dp_ssect;
|
||||
}
|
||||
if (drvread(sec, dsk.start + LABELSECTOR))
|
||||
return -1;
|
||||
d = (void *)(sec + LABELOFFSET);
|
||||
if (d->d_magic != DISKMAGIC || d->d_magic2 != DISKMAGIC) {
|
||||
if (dsk.part != RAW_PART) {
|
||||
reason = "label";
|
||||
goto error;
|
||||
}
|
||||
} else {
|
||||
if (dsk.part >= d->d_npartitions ||
|
||||
!d->d_partitions[dsk.part].p_size) {
|
||||
reason = "partition";
|
||||
goto error;
|
||||
}
|
||||
dsk.start += d->d_partitions[dsk.part].p_offset;
|
||||
dsk.start -= d->d_partitions[RAW_PART].p_offset;
|
||||
}
|
||||
unsliced: ;
|
||||
}
|
||||
for (p = buf; nblk; p += 512, lba++, nblk--) {
|
||||
if ((i = drvread(p, dsk.start + lba)))
|
||||
return i;
|
||||
}
|
||||
return 0;
|
||||
error:
|
||||
printf("Invalid %s\n", reason);
|
||||
return -1;
|
||||
}
|
||||
|
||||
static void
|
||||
printf(const char *fmt,...)
|
||||
{
|
||||
va_list ap;
|
||||
static char buf[10];
|
||||
char *s;
|
||||
unsigned u;
|
||||
int c;
|
||||
|
||||
va_start(ap, fmt);
|
||||
while ((c = *fmt++)) {
|
||||
if (c == '%') {
|
||||
c = *fmt++;
|
||||
switch (c) {
|
||||
case 'c':
|
||||
putchar(va_arg(ap, int));
|
||||
continue;
|
||||
case 's':
|
||||
for (s = va_arg(ap, char *); *s; s++)
|
||||
putchar(*s);
|
||||
continue;
|
||||
case 'u':
|
||||
u = va_arg(ap, unsigned);
|
||||
s = buf;
|
||||
do
|
||||
*s++ = '0' + u % 10U;
|
||||
while (u /= 10U);
|
||||
while (--s >= buf)
|
||||
putchar(*s);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
putchar(c);
|
||||
}
|
||||
va_end(ap);
|
||||
return;
|
||||
}
|
||||
|
||||
static void
|
||||
putchar(int c)
|
||||
{
|
||||
if (c == '\n')
|
||||
xputc('\r');
|
||||
xputc(c);
|
||||
}
|
||||
|
||||
static int
|
||||
drvread(void *buf, unsigned lba)
|
||||
{
|
||||
static unsigned c = 0x2d5c7c2f;
|
||||
unsigned bpc, x, cyl, head, sec;
|
||||
|
||||
bpc = dsk.sec * dsk.head;
|
||||
cyl = lba / bpc;
|
||||
x = lba % bpc;
|
||||
head = x / dsk.sec;
|
||||
sec = x % dsk.sec;
|
||||
|
||||
if (!OPT_CHECK(RBX_QUIET)) {
|
||||
xputc(c = c << 8 | c >> 24);
|
||||
xputc('\b');
|
||||
}
|
||||
v86.ctl = V86_ADDR | V86_CALLF | V86_FLAGS;
|
||||
v86.addr = READORG; /* call to read in boot1 */
|
||||
v86.ecx = cyl;
|
||||
v86.edx = (head << 8) | sec;
|
||||
v86.edi = lba;
|
||||
v86.ebx = 512;
|
||||
v86.es = VTOPSEG(buf);
|
||||
v86.ebp = VTOPOFF(buf);
|
||||
v86int();
|
||||
v86.ctl = V86_FLAGS;
|
||||
if (V86_CY(v86.efl)) {
|
||||
printf("error %u c/h/s %u/%u/%u lba %u\n", v86.eax >> 8 & 0xff,
|
||||
cyl, head, sec, lba);
|
||||
return -1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline void
|
||||
delay(void)
|
||||
{
|
||||
int i;
|
||||
|
||||
i = 800;
|
||||
do {
|
||||
outb(0x5f, 0); /* about 600ns */
|
||||
} while (--i >= 0);
|
||||
}
|
||||
|
||||
static int
|
||||
keyhit(unsigned sec)
|
||||
{
|
||||
unsigned i;
|
||||
|
||||
if (OPT_CHECK(RBX_NOINTR))
|
||||
return 0;
|
||||
for (i = 0; i < sec * 1000; i++) {
|
||||
if (xgetc(1))
|
||||
return 1;
|
||||
delay();
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
xputc(int c)
|
||||
{
|
||||
if (DO_KBD)
|
||||
putc(c);
|
||||
if (DO_SIO)
|
||||
sio_putc(c);
|
||||
return c;
|
||||
}
|
||||
|
||||
static int
|
||||
getc(int fn)
|
||||
{
|
||||
v86.addr = 0x18;
|
||||
v86.eax = fn << 8;
|
||||
v86int();
|
||||
if (fn)
|
||||
return (v86.ebx >> 8) & 0x01;
|
||||
else
|
||||
return v86.eax & 0xff;
|
||||
}
|
||||
|
||||
static int
|
||||
xgetc(int fn)
|
||||
{
|
||||
if (OPT_CHECK(RBX_NOINTR))
|
||||
return 0;
|
||||
for (;;) {
|
||||
if (DO_KBD && getc(1))
|
||||
return fn ? 1 : getc(0);
|
||||
if (DO_SIO && sio_ischar())
|
||||
return fn ? 1 : sio_getc();
|
||||
if (fn)
|
||||
return 0;
|
||||
}
|
||||
}
|
@ -1,5 +0,0 @@
|
||||
# $FreeBSD$
|
||||
|
||||
SUBDIR= btx btxldr lib
|
||||
|
||||
.include <bsd.subdir.mk>
|
@ -1,3 +0,0 @@
|
||||
# $FreeBSD$
|
||||
|
||||
.include "../Makefile.inc"
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user