Skip to content

Commit

Permalink
get vfprintf compiled
Browse files Browse the repository at this point in the history
  • Loading branch information
npe9 committed Jun 2, 2017
1 parent 98394eb commit 86aece9
Show file tree
Hide file tree
Showing 34 changed files with 68 additions and 52 deletions.
1 change: 1 addition & 0 deletions GNUmakerules-x86
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ _oskit_makerules_x86_ = yes

# Required compiler/assembler flags.
OSKIT_ASFLAGS += $(OSKIT_CPPFLAGS) -m32 -march=i386 -DASSEMBLER
OSKIT_LDFLAGS += -melf_i386


# Assembly language source files.
Expand Down
10 changes: 7 additions & 3 deletions boot/boot_start.c
Original file line number Diff line number Diff line change
Expand Up @@ -68,32 +68,36 @@ void boot_start(struct multiboot_info *bi)
copy_source = kvtophys(boot_kern_image);
copy_size = boot_kern_hdr.load_end_addr - boot_kern_hdr.load_addr;
if (copy_source > boot_kern_hdr.load_addr)
{
{
/*
asm volatile("
cld
ljmp %0
" :
: "mr" (ptr), /* XXX r is inappropriate but gcc wants it */
: "mr" (ptr), / * XXX r is inappropriate but gcc wants it * /
"a" (boot_kern_hdr.entry),
"S" (copy_source),
"D" (boot_kern_hdr.load_addr),
"c" (copy_size),
"b" (kvtophys(bi)),
"d" (LINEAR_DS));
*/
}
else
{
printf("(copying backwards...)\n"); /* XXX */
/*
asm volatile("
std
ljmp %0
" :
: "mr" (ptr), /* XXX r is inappropriate but gcc wants it */
: "mr" (ptr), / * XXX r is inappropriate but gcc wants it * /
"a" (boot_kern_hdr.entry),
"S" (copy_source + copy_size - 1),
"D" (boot_kern_hdr.load_addr + copy_size - 1),
"c" (copy_size),
"b" (kvtophys(bi)),
"d" (LINEAR_DS));
*/
}
}
2 changes: 2 additions & 0 deletions boot/net/gdt.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,12 @@ gdt_load(struct x86_desc *gdtp, oskit_size_t len)
/*
* Reload all the segment registers from the new GDT.
*/
/*
asm volatile("
ljmp %0,$1f
1:
" : : "i" (KERNEL_CS));
*/
set_ds(KERNEL_DS);
set_es(KERNEL_DS);
set_ss(KERNEL_DS);
Expand Down
8 changes: 6 additions & 2 deletions boot/net/loadkernel.c
Original file line number Diff line number Diff line change
Expand Up @@ -101,29 +101,33 @@ loadkernel(struct kerninfo *ki)
dprintf("stub = %p-%p\n", stub, stub + stub_size);

if (copy_source > load_addr) {
/*
asm volatile("
cld
ljmp %0
" : /* no outputs */
" : / * no outputs * /
: "mr" (ptr),
"a" (entry),
"S" (copy_source),
"D" (load_addr),
"c" (copy_size),
"b" (kvtophys(ki->ki_mbinfo)),
"d" (LINEAR_DS));
*/
}
else {
/*
asm volatile("
std
ljmp %0
" : /* no outputs */
" : / * no outputs * /
: "mr" (ptr),
"a" (entry),
"S" (copy_source + copy_size - 1),
"D" (load_addr + copy_size - 1),
"c" (copy_size),
"b" (kvtophys(ki->ki_mbinfo)),
"d" (LINEAR_DS));
*/
}
}
3 changes: 1 addition & 2 deletions freebsd/3.x/src/lib/libc/stdio/vfprintf.c
Original file line number Diff line number Diff line change
Expand Up @@ -1174,7 +1174,7 @@ reswitch: switch (ch) {
if ((typetable != NULL) && (typetable != stattypetable))
free (typetable);
}

}
/*
* Increase the size of the type table.
*/
Expand Down Expand Up @@ -1202,7 +1202,6 @@ __grow_type_table (nextarg, typetable, tablesize)
*tablesize = newsize;
}


#ifdef FLOATING_POINT

extern char *__dtoa __P((double, int, int, int *, int *, char **));
Expand Down
2 changes: 1 addition & 1 deletion linux/dev/global.h
Original file line number Diff line number Diff line change
Expand Up @@ -808,7 +808,7 @@ i486-linux-nm liboskit_linux_dev.a | grep ' [TDRC] ' | egrep -vi ' (oskit_|fdev_
#define bh_base FDEV_LINUX_bh_base
#define bh_mask FDEV_LINUX_bh_mask
#define bh_mask_count FDEV_LINUX_bh_mask_count
#define do_bottom_half FDEV_LINUX_do_bottom_half
//#define do_bottom_half FDEV_LINUX_do_bottom_half
#define local_bh_count FDEV_LINUX_local_bh_count
#define proc_scsi_t128 FDEV_LINUX_proc_scsi_t128
#define t128_abort FDEV_LINUX_t128_abort
Expand Down
6 changes: 3 additions & 3 deletions linux/dev/softintr.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,21 +55,21 @@ unsigned int local_bh_count[1]; /* SMP */
* Our softirq vector that osenv gave back to us.
*/
int softintr_vector;
static void linux_softintr_handler(void *arg);

void
linux_softintr_init(void)
{
int err;
static void linux_softintr_handler(void *arg);

err = osenv_softirq_alloc_vector(&softintr_vector);
if (err)
panic(__FUNCTION__ ": Could not allocate softirq vector\n");
panic("%s: Could not allocate softirq vector\n", __FUNCTION__);

err = osenv_softirq_alloc(softintr_vector,
linux_softintr_handler, 0, 0);
if (err)
panic(__FUNCTION__ ": Could not allocate softirq handler\n");
panic("%s: Could not allocate softirq handler\n", __FUNCTION__);
}

/*
Expand Down
4 changes: 2 additions & 2 deletions linux/fs/types.h
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,9 @@ extern oskit_error_t gopenfile_create(gfile_t *file, struct file *f,
*/
#define VERIFY_OR_PANIC(obj, name) ({ \
if ((obj) == NULL) \
panic(__FUNCTION__": null " #name); \
panic("%s: null " #name, __FUNCTION__); \
if ((obj)->count == 0) \
panic(__FUNCTION__": bad count"); \
panic("%s: bad count", __FUNCTION__); \
})
static inline
int verify_fs(gfilesystem_t *obj, void* non_null_data)
Expand Down
4 changes: 2 additions & 2 deletions linux/shared/global.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@
#endif

#define BIOS_START OSKIT_LINUX_BIOS_START
#define __down OSKIT_LINUX___down
//#define __down OSKIT_LINUX___down
#define __get_free_pages OSKIT_LINUX___get_free_pages
#define __up OSKIT_LINUX___up
//#define __up OSKIT_LINUX___up
#define __wake_up OSKIT_LINUX___wake_up
#define __wait_on_buffer OSKIT_LINUX___wait_on_buffer
#define _const_udelay OSKIT_LINUX__const_udelay
Expand Down
8 changes: 4 additions & 4 deletions linux/shared/x86/s_intr.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@ unsigned
linux_save_flags()
{
unsigned rc;

/*
asm volatile("
pushfl
popl %0" : "=r" (rc));

*/
rc &= ~IF_FLAG;
if (osenv_intr_enabled())
rc |= IF_FLAG;
Expand All @@ -63,11 +63,11 @@ unsigned
linux_save_flags_cli()
{
unsigned rc;

/*
asm volatile("
pushfl
popl %0" : "=r" (rc));

*/
rc &= ~IF_FLAG;
if (osenv_intr_save_disable())
rc |= IF_FLAG;
Expand Down
2 changes: 1 addition & 1 deletion linux/src/drivers/block/ide-cd.h
Original file line number Diff line number Diff line change
Expand Up @@ -528,7 +528,7 @@ struct atapi_mechstat_header {

byte curlba[3];
byte nslots;
__u8 short slot_tablelen;
short slot_tablelen;
};


Expand Down
3 changes: 2 additions & 1 deletion linux/src/drivers/net/3c507.c
Original file line number Diff line number Diff line change
Expand Up @@ -510,6 +510,8 @@ static int el16_send_packet(struct sk_buff *skb, struct device *dev)
return 0;
}

static void init_rx_bufs(struct device *);

/* The typical workload of the driver:
Handle the network interface interrupts. */
static void el16_interrupt(int irq, void *dev_id, struct pt_regs *regs)
Expand Down Expand Up @@ -592,7 +594,6 @@ static void el16_interrupt(int irq, void *dev_id, struct pt_regs *regs)

if ((status & 0x0070) != 0x0040 && dev->start)
{
static void init_rx_bufs(struct device *);
/* The Rx unit is not ready, it must be hung. Restart the receiver by
initializing the rx buffers, and issuing an Rx start command. */
if (net_debug)
Expand Down
2 changes: 1 addition & 1 deletion linux/src/drivers/net/hp100.c
Original file line number Diff line number Diff line change
Expand Up @@ -741,7 +741,7 @@ __initfunc(static int hp100_probe1( struct device *dev, int ioaddr, u_char bus,
{
mem_ptr_phys = (u_int *)( hp100_inw( MEM_MAP_LSW ) |
( hp100_inw( MEM_MAP_MSW ) << 16 ) );
(u_int)mem_ptr_phys &= ~0x1fff; /* 8k alignment */
//mem_ptr_phys &= ~0x1fff; /* 8k alignment */

if ( bus == HP100_BUS_ISA && ( (u_long)mem_ptr_phys & ~0xfffff ) != 0 )
{
Expand Down
2 changes: 1 addition & 1 deletion linux/src/drivers/scsi/53c7,8xx.c
Original file line number Diff line number Diff line change
Expand Up @@ -3969,7 +3969,7 @@ NCR53c7xx_queue_command (Scsi_Cmnd *cmd, void (* done)(Scsi_Cmnd *)) {
restore_flags (flags);
cmd->result = le32_to_cpu(0xffff); /* The NCR will overwrite message
and status with valid data */
cmd->host_scribble = (unsigned char *) tmp = create_cmd (cmd);
cmd->host_scribble = tmp = create_cmd (cmd);
}
cli();
/*
Expand Down
12 changes: 2 additions & 10 deletions linux/src/drivers/scsi/53c7,8xx.h
Original file line number Diff line number Diff line change
Expand Up @@ -1523,16 +1523,8 @@ struct NCR53c7x0_hostdata {
DBC_TCI_DATA_MASK)

/* Patch field in dsa structure (assignment should be +=?) */
#define patch_dsa_32(dsa, symbol, word, value) \
{ \
(dsa)[(hostdata->##symbol - hostdata->dsa_start) / sizeof(u32) \
+ (word)] = (value); \
if (hostdata->options & OPTION_DEBUG_DSA) \
printk("scsi : dsa %s symbol %s(%d) word %d now 0x%x\n", \
#dsa, #symbol, hostdata->##symbol, \
(word), (u32) le32_to_cpu(value)); \
}

#define patch_dsa_32(dsa, symbol, word, value)

/* Paranoid people could use panic() here. */
#define FATAL(host) shutdown((host));

Expand Down
6 changes: 3 additions & 3 deletions linux/src/drivers/scsi/advansys.c
Original file line number Diff line number Diff line change
Expand Up @@ -3255,8 +3255,8 @@ Forced Error: Driver must define ADV_MAX_SG_LIST.
* REQTIMESTAMP() - system time stamp value
*/
typedef Scsi_Cmnd REQ, *REQP;
#define REQPNEXT(reqp) ((REQP) ((reqp)->host_scribble))
#define REQPNEXTP(reqp) ((REQP *) &((reqp)->host_scribble))
#define REQPNEXT(reqp) (((reqp)->host_scribble))
#define REQPNEXTP(reqp) (&((reqp)->host_scribble))
#define REQPTID(reqp) ((reqp)->target)
#define REQPTIME(reqp) ((reqp)->SCp.this_residual)
#define REQTIMESTAMP() (jiffies)
Expand Down Expand Up @@ -14129,7 +14129,7 @@ unsigned long _adv_mcode_chksum ASC_INITDATA = 0x03494981UL;
* Additional structure information can be found in a_condor.h where
* the structure is defined.
*/
STATIC ADVEEP_CONFIG
ADVEEP_CONFIG
Default_EEPROM_Config ASC_INITDATA = {
ADV_EEPROM_BIOS_ENABLE, /* cfg_msw */
0x0000, /* cfg_lsw */
Expand Down
2 changes: 1 addition & 1 deletion linux/src/drivers/scsi/qlogicisp.c
Original file line number Diff line number Diff line change
Expand Up @@ -535,7 +535,7 @@ static void isp1020_print_scsi_cmd(Scsi_Cmnd *);
static void isp1020_print_status_entry(struct Status_Entry *);
#endif

static struct proc_dir_entry proc_scsi_isp1020 = {
struct proc_dir_entry proc_scsi_isp1020 = {
PROC_SCSI_QLOGICISP, 7, "isp1020",
S_IFDIR | S_IRUGO | S_IXUGO, 2
};
Expand Down
1 change: 1 addition & 0 deletions linux/src/drivers/scsi/scsi.c
Original file line number Diff line number Diff line change
Expand Up @@ -3290,6 +3290,7 @@ void scsi_unregister_module(int module_type, void * ptr)
case MODULE_SCSI_IOCTL:
break;
default:
;
}
return;
}
Expand Down
2 changes: 1 addition & 1 deletion linux/src/drivers/scsi/seagate.c
Original file line number Diff line number Diff line change
Expand Up @@ -678,7 +678,7 @@ int seagate_st0x_queue_command (Scsi_Cmnd * SCpnt, void (*done) (Scsi_Cmnd *))
done_fn = done;
current_target = SCpnt->target;
current_lun = SCpnt->lun;
(const void *) current_cmnd = SCpnt->cmnd;
current_cmnd = SCpnt->cmnd;
current_data = (unsigned char *) SCpnt->request_buffer;
current_bufflen = SCpnt->request_bufflen;
SCint = SCpnt;
Expand Down
4 changes: 2 additions & 2 deletions linux/src/drivers/scsi/u14-34f.c
Original file line number Diff line number Diff line change
Expand Up @@ -1775,8 +1775,8 @@ static inline void ihdlr(int irq, unsigned int j) {
BN(j), irq, reg, HD(j)->iocount);
return;
}

spp = (struct mscp *)DEV2V(ret = inl(sh[j]->io_port + REG_ICM));
ret = inl(sh[j]->io_port + REG_ICM);
spp = DEV2V(ret);
cpp = spp;

/* Clear interrupt pending flag */
Expand Down
1 change: 1 addition & 0 deletions linux/src/drivers/sound/sb_ess.c
Original file line number Diff line number Diff line change
Expand Up @@ -775,6 +775,7 @@ printk(KERN_INFO "FKS: ess_handle_channel %s irq_mode=%d\n", channel, irq_mode);
break;

default:
;
/* printk(KERN_WARN "ESS: Unexpected interrupt\n"); */
}
}
Expand Down
5 changes: 4 additions & 1 deletion linux/src/fs/affs/super.c
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,10 @@ parse_options(char *options, uid_t *uid, gid_t *gid, int *mode, int *reserved, s
printk("AFFS: Argument for set[ug]id option missing\n");
return 0;
} else {
(f ? *uid : *gid) = simple_strtoul(value,&value,0);
if(f)
*uid = simple_strtoul(value,&value,0);
else
*gid = simple_strtoul(value,&value,0);
if (*value) {
printk("AFFS: Bad set[ug]id argument\n");
return 0;
Expand Down
4 changes: 2 additions & 2 deletions linux/src/fs/buffer.c
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,9 @@ static struct buffer_head * unused_list = NULL;
static struct buffer_head * reuse_list = NULL;
static struct wait_queue * buffer_wait = NULL;

static int nr_buffers = 0;
int nr_buffers = 0;
static int nr_buffers_type[NR_LIST] = {0,};
static int nr_buffer_heads = 0;
int nr_buffer_heads = 0;
static int nr_unused_buffer_heads = 0;
static int nr_hashed_buffers = 0;

Expand Down
1 change: 1 addition & 0 deletions linux/src/fs/sysv/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -443,6 +443,7 @@ struct super_block *sysv_read_super(struct super_block *sb,void *data,
printk("SysV FS: cannot read superblock in %d byte mode\n", sb->sv_block_size);
goto failed;
superblock_ok:
;
}
} else {
/* Switch to 512 block size. Unfortunately, we have to
Expand Down
2 changes: 1 addition & 1 deletion linux/src/fs/ufs/dir.c
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ int ufs_check_dir_entry (const char * function, struct inode * dir,
return (error_msg == NULL ? 1 : 0);
}

static struct file_operations ufs_dir_operations = {
struct file_operations ufs_dir_operations = {
NULL, /* lseek */
NULL, /* read */
NULL, /* write */
Expand Down
2 changes: 1 addition & 1 deletion linux/src/fs/ufs/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ static int ufs_release_file (struct inode *, struct file *);
* We have mostly NULL's here: the current defaults are ok for
* the ufs filesystem.
*/
static struct file_operations ufs_file_operations = {
struct file_operations ufs_file_operations = {
ufs_file_lseek, /* lseek */
generic_file_read, /* read */
ufs_file_write, /* write */
Expand Down
4 changes: 2 additions & 2 deletions linux/src/fs/ufs/super.c
Original file line number Diff line number Diff line change
Expand Up @@ -921,7 +921,7 @@ int ufs_statfs (struct super_block * sb, struct statfs * buf, int bufsiz)
return copy_to_user(buf, &tmp, bufsiz) ? -EFAULT : 0;
}

static struct super_operations ufs_super_ops = {
struct super_operations ufs_super_ops = {
ufs_read_inode,
ufs_write_inode,
ufs_put_inode,
Expand All @@ -933,7 +933,7 @@ static struct super_operations ufs_super_ops = {
ufs_remount
};

static struct file_system_type ufs_fs_type = {
struct file_system_type ufs_fs_type = {
"ufs",
FS_REQUIRES_DEV,
ufs_read_super,
Expand Down
Loading

0 comments on commit 86aece9

Please sign in to comment.